mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-21 13:10:08 +01:00
bench: Add --sanity-check flag, use it in make check
The benchmarks are run as part of `make check` for a minimum sanity check. The actual results are being ignored. So only run them for one iteration. This makes the `bench_bitcoin` part take 2m00 instead of 5m20 here. Which is still too long (imo), but this needs to be solved in the `WalletLoading*` benchmarks which take that long per iteration.
This commit is contained in:
@@ -57,6 +57,10 @@ void benchmark::BenchRunner::RunAll(const Args& args)
|
||||
std::regex reFilter(args.regex_filter);
|
||||
std::smatch baseMatch;
|
||||
|
||||
if (args.sanity_check) {
|
||||
std::cout << "Running with --sanity check option, benchmark results will be useless." << std::endl;
|
||||
}
|
||||
|
||||
std::vector<ankerl::nanobench::Result> benchmarkResults;
|
||||
for (const auto& p : benchmarks()) {
|
||||
if (!std::regex_match(p.first, baseMatch, reFilter)) {
|
||||
@@ -69,6 +73,9 @@ void benchmark::BenchRunner::RunAll(const Args& args)
|
||||
}
|
||||
|
||||
Bench bench;
|
||||
if (args.sanity_check) {
|
||||
bench.epochs(1).epochIterations(1);
|
||||
}
|
||||
bench.name(p.first);
|
||||
if (args.min_time > 0ms) {
|
||||
// convert to nanos before dividing to reduce rounding errors
|
||||
|
||||
Reference in New Issue
Block a user