Skip to content

Conversation

brunoerg
Copy link
Contributor

This PR adds time duration for anchors.dat deserialization (following the same logic that peers.dat).
Also, it removes the quotes of "anchors.dat" in LogPrintf to follow the pattern of other logs.

@hebasto
Copy link
Member

hebasto commented Mar 20, 2021

@brunoerg To be precise, this change is not a refactoring as it does change a log message, i.e., behavior :)

@brunoerg brunoerg changed the title p2p, refactor: add time when deserialize file db for ReadAnchors p2p: add time when deserialize file db for ReadAnchors Mar 20, 2021
@brunoerg
Copy link
Contributor Author

@hebasto Agreed! Just removed it! I was in doubt about the "tag"

@DrahtBot
Copy link
Contributor

DrahtBot commented May 25, 2021

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

No conflicts as of last run.

Copy link
Contributor

@lsilva01 lsilva01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested ACK 1b897ed on Ubuntu 20.04

Loaded 2 addresses from anchors.dat 0ms

Is this time usually 0ms ?

@brunoerg
Copy link
Contributor Author

Tested ACK 1b897ed on Ubuntu 20.04

Loaded 2 addresses from anchors.dat 0ms

Is this time usually 0ms ?

Interesting, I think considering the number of addresses for this case this value should be always low (0ms? ou near it?).

@maflcko
Copy link
Member

maflcko commented Oct 22, 2021

Needs rebase if still relevant

try {
DeserializeFileDB(anchors_db_path, anchors, CLIENT_VERSION | ADDRV2_FORMAT);
LogPrintf("Loaded %i addresses from %s\n", anchors.size(), fs::quoted(fs::PathToString(anchors_db_path.filename())));
LogPrintf("Loaded %i addresses from %s %dms\n", anchors.size(), fs::PathToString(anchors_db_path.filename()), GetTimeMillis() - nStart);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about moving away from fs::quoted here. There's also other places where quoted is used for logging. I'm not sure what's the plan there, but I'd like to avoid back-and-forth.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree.. I will close it.

@brunoerg brunoerg closed this Apr 18, 2022
@bitcoin bitcoin locked and limited conversation to collaborators Apr 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants