Add tree hash benches

This commit is contained in:
Paul Hauner
2019-03-10 18:31:14 +11:00
parent f27b62d410
commit 21d75ef0bd
3 changed files with 24 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
use benching_utils::{BeaconBlockBencher, BeaconStateBencher};
use criterion::Criterion;
use criterion::{black_box, Benchmark};
use ssz::TreeHash;
use state_processing::{
per_block_processing,
per_block_processing::{
@@ -400,4 +401,13 @@ fn bench_block_processing(
})
.sample_size(10),
);
let block = initial_block.clone();
c.bench(
&format!("block_processing_{}", desc),
Benchmark::new("tree_hash_block", move |b| {
b.iter(|| black_box(block.hash_tree_root()))
})
.sample_size(10),
);
}