lighthouse/eth2/state_processing/benches/benches.rs

27 lines
819 B
Rust
Raw Normal View History

use criterion::Benchmark;
2019-03-11 08:46:22 +00:00
use criterion::Criterion;
use criterion::{criterion_group, criterion_main};
use env_logger::{Builder, Env};
use types::test_utils::TestingBeaconStateBuilder;
use types::*;
2019-03-11 22:57:00 +00:00
mod bench_block_processing;
mod bench_epoch_processing;
2019-03-11 08:46:22 +00:00
pub const VALIDATOR_COUNT: usize = 300_032;
// `LOG_LEVEL == "debug"` gives logs, but they're very noisy and slow down benching.
pub const LOG_LEVEL: &str = "";
2019-03-11 08:46:22 +00:00
pub fn state_processing(c: &mut Criterion) {
if LOG_LEVEL != "" {
Builder::from_env(Env::default().default_filter_or(LOG_LEVEL)).init();
}
bench_epoch_processing::bench_epoch_processing_n_validators(c, VALIDATOR_COUNT);
bench_block_processing::bench_block_processing_n_validators(c, VALIDATOR_COUNT);
2019-03-11 08:46:22 +00:00
}
criterion_group!(benches, state_processing);
criterion_main!(benches);