15 std::vector<uint256> leaves;
17 for (
auto& item : leaves) {
20 bench.
batch(leaves.size()).unit(
"leaf").
run([&] {
21 bool mutation =
false;
23 leaves[mutation] = hash;
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
uint256 ComputeMerkleRoot(std::vector< uint256 > hashes, bool *mutated)
uint256 rand256() noexcept
generate a random uint256.
static void MerkleRoot(benchmark::Bench &bench)
Main entry point to nanobench's benchmarking facility.
Bench & batch(T b) noexcept
Sets the batch size.
BENCHMARK(MerkleRoot, benchmark::PriorityLevel::HIGH)