Review report

core: PR #35827

2 suggestions

Optional improvements

Link

[suggestion] · Aggregate syscall comparisons need an equal-iteration precondition

Aggregate strace counts can misrepresent writes per iteration when faster benchmarks or a raised -min-time cause the compared builds to execute different iteration counts.

Location: doc/benchmarking.md:87 (head).

Details and suggested fix

Nanobench adjusts iteration counts using elapsed time; minEpochIterations(5) only sets a floor. The slow index syncs remain floor-bound at the default -min-time=10, so the comparison works in that case. For fast benchmarks or a sufficiently increased -min-time, a faster build can execute more iterations and report more total writes despite issuing fewer per iteration. Document that aggregate counts are comparable only after checking that both runs perform equal work, including calibration iterations. Process-wide tracing also includes untimed fixture construction, so the totals are not solely sync-loop writes.


Link

[suggestion] · Random fixture keys prevent reproducible index workloads

ExtendChainWithSpends bypasses the test RNG seed when generating keys, so before-and-after benchmark runs index different transactions, block hashes, and filter elements.

Location: src/bench/index_sync_util.cpp:43 (head).

Details and suggested fix

GenerateRandomKey() calls CKey::MakeNewKey(), which uses GetStrongRandBytes() and is not made deterministic by the test RNG seed. Each benchmark invocation therefore builds a different extended chain, although all timed sync iterations within that invocation share it. The timing effect is probably small because script and signature sizes are nearly fixed, but byte-for-byte filter and on-disk-size comparisons cannot use identical chain input. Derive the fixture keys from fixed valid scalars, such as i + 2, using CKey::Set() as the setup already does for coinbaseKey. This preserves distinct output scripts and valid signatures while making the synthetic chain reproducible.


Coverage details