Changeset View
Changeset View
Standalone View
Standalone View
src/bench/checkblock.cpp
Show All 40 Lines | static void DeserializeAndCheckBlockTest(benchmark::State &state) { | ||||
while (state.KeepRunning()) { | while (state.KeepRunning()) { | ||||
// Note that CBlock caches its checked state, so we need to recreate it | // Note that CBlock caches its checked state, so we need to recreate it | ||||
// here. | // here. | ||||
CBlock block; | CBlock block; | ||||
stream >> block; | stream >> block; | ||||
bool rewound = stream.Rewind(benchmark::data::block413567.size()); | bool rewound = stream.Rewind(benchmark::data::block413567.size()); | ||||
assert(rewound); | assert(rewound); | ||||
CValidationState validationState; | BlockValidationState validationState; | ||||
bool checked = CheckBlock(block, validationState, params, options); | bool checked = CheckBlock(block, validationState, params, options); | ||||
assert(checked); | assert(checked); | ||||
} | } | ||||
} | } | ||||
BENCHMARK(DeserializeBlockTest, 130); | BENCHMARK(DeserializeBlockTest, 130); | ||||
BENCHMARK(DeserializeAndCheckBlockTest, 160); | BENCHMARK(DeserializeAndCheckBlockTest, 160); |