bench: add CAddrMan benchmarks #18754

pull vasild wants to merge 1 commits into bitcoin:master from vasild:addrman_perf_test changing 2 files +141 −0
  1. vasild commented at 9:38 AM on April 24, 2020: member

    The added benchmarks exercise the public methods Add(), GetAddr(), Select() and Good().

  2. bench: add CAddrMan benchmarks
    The added benchmarks exercise the public methods Add(), GetAddr(),
    Select() and Good().
    a9b957740e
  3. vasild commented at 9:39 AM on April 24, 2020: member

    Extracted from #18722 upon request.

  4. fanquake added the label Tests on Apr 24, 2020
  5. in src/bench/addrman.cpp:26 in a9b957740e
      21 | +{
      22 | +    if (g_sources.size() > 0) { // already created
      23 | +        return;
      24 | +    }
      25 | +
      26 | +    FastRandomContext rng(uint256(std::vector<unsigned char>(32, 123)));
    


    MarcoFalke commented at 11:48 PM on April 24, 2020:

    nit: I think you can just set

        FastRandomContext rng(/* deterministic */ true);
    

    or is there a reason for the seed?


    vasild commented at 9:58 AM on April 27, 2020:

    Right, /* deterministic */ true would have been better. I will have this in mind and also change this code if I am touching it again.

    There is no need for the chosen seed - it only has to be the same every time to reduce noise in performance tests.

    Thanks!

  6. MarcoFalke approved
  7. MarcoFalke commented at 11:54 PM on April 24, 2020: member

    ACK a9b957740e3490d87e5ce0b7f1b93ba43bb19764

  8. MarcoFalke commented at 11:54 PM on April 24, 2020: member

    cc @naumenkogs (you might be interested in this)

  9. naumenkogs commented at 12:31 PM on April 25, 2020: member

    utACK a9b9577

  10. MarcoFalke merged this on Apr 25, 2020
  11. MarcoFalke closed this on Apr 25, 2020

  12. sidhujag referenced this in commit 505295b28d on Apr 25, 2020
  13. vasild deleted the branch on Apr 27, 2020
  14. Fabcien referenced this in commit 8b0b3a1909 on Jan 21, 2021
  15. ftrader referenced this in commit 333436177e on Apr 14, 2021
  16. DrahtBot locked this on Feb 15, 2022
Labels

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: 2026-04-25 15:15 UTC

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