This PR is a brainstorming to gather opinions if there is interest in rewrite the benchmarking framework, to make it more usable and extensible. I currently have a quick hack to test a new API. It shows a few ideas:
- Move benchmarking code into tests: the macro
BENCHMARK
creates a boost test with the labelbenchmark
, that is disabled by default. To run all benchmarks, execute./test_bitcoin --run_test=@benchmark
. - Configuration & running of a benchmark is one place:
The configuration can be easily extended with other attributes, e.g. output configuration, automatic runtime configuration, etc.
0Benchmark("resize").Iters(1000).Run([] { 1 // code 2});
Please have a look at my change to prevector_tests.cpp which shows a working example.
If there is interest in such a refactoring, I can spend some time on it