Merge pull request #301 from sigp/new-pubkey-format

Add pubkey cache
This commit is contained in:
Age Manning
2019-03-17 12:17:06 +11:00
committed by GitHub
9 changed files with 131 additions and 12 deletions

View File

@@ -426,6 +426,23 @@ fn bench_block_processing(
.sample_size(10),
);
let mut state = initial_state.clone();
state.drop_pubkey_cache();
c.bench(
&format!("{}/block_processing", desc),
Benchmark::new("build_pubkey_cache", move |b| {
b.iter_batched(
|| state.clone(),
|mut state| {
state.update_pubkey_cache().unwrap();
state
},
criterion::BatchSize::SmallInput,
)
})
.sample_size(10),
);
let block = initial_block.clone();
c.bench(
&format!("{}/block_processing", desc),

View File

@@ -1,14 +1,11 @@
use criterion::Benchmark;
use criterion::Criterion;
use criterion::{criterion_group, criterion_main};
use env_logger::{Builder, Env};
use types::test_utils::TestingBeaconStateBuilder;
use types::*;
mod bench_block_processing;
mod bench_epoch_processing;
pub const VALIDATOR_COUNT: usize = 300_032;
pub const VALIDATOR_COUNT: usize = 16_384;
// `LOG_LEVEL == "debug"` gives logs, but they're very noisy and slow down benching.
pub const LOG_LEVEL: &str = "";