Merge pull request #6084 from str4d/fix-connectblock-benchmarks

bench: Fix ConnectBlock large block benchmarks
This commit is contained in:
Daira Hopwood 2022-07-18 15:27:57 +01:00 committed by GitHub
commit dc7f3e74fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -3094,8 +3094,9 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
fExpensiveChecks = false;
}
// Don't cache results if we're actually connecting blocks (still consult the cache, though).
bool fCacheResults = fJustCheck;
// Don't cache results if we're actually connecting blocks or benchmarking
// (still consult the cache, though, which will be empty for benchmarks).
bool fCacheResults = fJustCheck && (blockChecks != CheckAs::SlowBenchmark);
// proof verification is expensive, disable if possible
auto verifier = fExpensiveChecks ? ProofVerifier::Strict() : ProofVerifier::Disabled();

View File

@ -594,7 +594,7 @@ double benchmark_connectblock_slow()
CValidationState state;
struct timeval tv_start;
timer_start(tv_start);
assert(ConnectBlock(block, state, &index, view, Params(), true));
assert(ConnectBlock(block, state, &index, view, Params(), true, CheckAs::SlowBenchmark));
auto duration = timer_stop(tv_start);
// Undo alterations to global state