We're using nanobench in Bitcoin Core to track performance regressions.
One of the features I'm missing most is the ability to do untracked pre-calculations or post-calculations for benchmarks that mutate the data (and cannot be trivially repeated).
Preconditions:
Postcondition:
Google Benchmark has an explicit PauseTiming / ResumeTiming (https://github.com/google/benchmark/blob/main/docs/user_guide.md#controlling-timers), but that would likely introduce needless complexity.
What would probably suffice in our case would be to have setup and cleanup lambdas as well, in addition to the timed run. Probably either of those could be enough as well, e.g. a setup. I don't mind implementing this myself if you think it's a good idea.
We're using
nanobenchin Bitcoin Core to track performance regressions.One of the features I'm missing most is the ability to do untracked pre-calculations or post-calculations for benchmarks that mutate the data (and cannot be trivially repeated).
Preconditions:
ConnectBlockisn't trivial: https://github.com/bitcoin/bitcoin/blob/master/src/bench/connectblock.cpp#L100Postcondition:
Google Benchmark has an explicit
PauseTiming/ResumeTiming(https://github.com/google/benchmark/blob/main/docs/user_guide.md#controlling-timers), but that would likely introduce needless complexity.What would probably suffice in our case would be to have
setupandcleanuplambdas as well, in addition to the timedrun. Probably either of those could be enough as well, e.g. asetup. I don't mind implementing this myself if you think it's a good idea.