p2p: add time when deserialize file db for ReadAnchors #21483

pull brunoerg wants to merge 1 commits into bitcoin:master from brunoerg:2021-03-time-anchors changing 1 files +4 −1
  1. brunoerg commented at 0:31 am on March 20, 2021: member
    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.
  2. fanquake added the label P2P on Mar 20, 2021
  3. fanquake added the label Utils/log/libs on Mar 20, 2021
  4. hebasto commented at 0:34 am on March 20, 2021: member
    @brunoerg To be precise, this change is not a refactoring as it does change a log message, i.e., behavior :)
  5. brunoerg renamed this:
    p2p, refactor: add time when deserialize file db for ReadAnchors
    p2p: add time when deserialize file db for ReadAnchors
    on Mar 20, 2021
  6. brunoerg commented at 0:41 am on March 20, 2021: member
    @hebasto Agreed! Just removed it! I was in doubt about the “tag”
  7. DrahtBot commented at 10:56 am on May 25, 2021: member

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

    Conflicts

    No conflicts as of last run.

  8. DrahtBot added the label Needs rebase on Jun 17, 2021
  9. brunoerg force-pushed on Jun 17, 2021
  10. lsilva01 approved
  11. lsilva01 commented at 7:55 pm on June 22, 2021: contributor

    Tested ACK https://github.com/bitcoin/bitcoin/pull/21483/commits/1b897ed000b86458fb9642c4119777688932fd27 on Ubuntu 20.04

    Loaded 2 addresses from anchors.dat 0ms

    Is this time usually 0ms ?

  12. brunoerg commented at 9:06 pm on June 22, 2021: member

    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?).

  13. MarcoFalke commented at 12:05 pm on October 22, 2021: member
    Needs rebase if still relevant
  14. p2p: add time when deserialize file db for ReadAnchors c7ace43d11
  15. brunoerg force-pushed on Oct 28, 2021
  16. DrahtBot removed the label Needs rebase on Oct 28, 2021
  17. in src/addrdb.cpp:221 in c7ace43d11
    213@@ -213,9 +214,11 @@ void DumpAnchors(const fs::path& anchors_db_path, const std::vector<CAddress>& a
    214 std::vector<CAddress> ReadAnchors(const fs::path& anchors_db_path)
    215 {
    216     std::vector<CAddress> anchors;
    217+    int64_t nStart = GetTimeMillis();
    218+
    219     try {
    220         DeserializeFileDB(anchors_db_path, anchors, CLIENT_VERSION | ADDRV2_FORMAT);
    221-        LogPrintf("Loaded %i addresses from %s\n", anchors.size(), fs::quoted(fs::PathToString(anchors_db_path.filename())));
    222+        LogPrintf("Loaded %i addresses from %s %dms\n", anchors.size(), fs::PathToString(anchors_db_path.filename()), GetTimeMillis() - nStart);
    


    laanwj commented at 7:59 am on April 14, 2022:
    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.

    brunoerg commented at 1:02 pm on April 18, 2022:
    I agree.. I will close it.
  18. brunoerg closed this on Apr 18, 2022

  19. DrahtBot locked this on Apr 18, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-19 00:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me