2019-03-11 08:46:22 +00:00
|
|
|
use criterion::Criterion;
|
2019-03-08 23:45:28 +00:00
|
|
|
use criterion::{criterion_group, criterion_main};
|
2019-03-12 06:16:12 +00:00
|
|
|
use env_logger::{Builder, Env};
|
2019-02-26 03:27:42 +00:00
|
|
|
|
2019-03-11 22:57:00 +00:00
|
|
|
mod bench_block_processing;
|
|
|
|
mod bench_epoch_processing;
|
2019-02-26 03:27:42 +00:00
|
|
|
|
2019-03-13 05:40:28 +00:00
|
|
|
pub const VALIDATOR_COUNT: usize = 16_384;
|
2019-03-11 08:46:22 +00:00
|
|
|
|
2019-03-12 06:16:12 +00:00
|
|
|
// `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) {
|
2019-03-12 06:16:12 +00:00
|
|
|
if LOG_LEVEL != "" {
|
|
|
|
Builder::from_env(Env::default().default_filter_or(LOG_LEVEL)).init();
|
|
|
|
}
|
|
|
|
|
2019-03-12 03:39:16 +00:00
|
|
|
bench_epoch_processing::bench_epoch_processing_n_validators(c, VALIDATOR_COUNT);
|
2019-03-14 00:53:50 +00:00
|
|
|
bench_block_processing::bench_block_processing_n_validators(c, VALIDATOR_COUNT);
|
2019-03-11 08:46:22 +00:00
|
|
|
}
|
|
|
|
|
2019-03-12 06:16:12 +00:00
|
|
|
criterion_group!(benches, state_processing);
|
2019-02-26 03:27:42 +00:00
|
|
|
criterion_main!(benches);
|