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: contributor

    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: contributor

    Extracted from #18722 upon request.

  4. vasild cross-referenced this on Apr 24, 2020 from issue addrman: improve performance by using more suitable containers by vasild
  5. fanquake added the label Tests on Apr 24, 2020
  6. 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!

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

    ACK a9b957740e3490d87e5ce0b7f1b93ba43bb19764

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

    cc @naumenkogs (you might be interested in this)

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

    utACK a9b9577

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

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

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-05-19 06:54 UTC