mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2025-01-02 09:17:39 +00:00
Move state processing benches around
This commit is contained in:
parent
85e7dd8b5a
commit
292991810d
@ -1,11 +1,15 @@
|
|||||||
|
use criterion::Criterion;
|
||||||
use criterion::{criterion_group, criterion_main};
|
use criterion::{criterion_group, criterion_main};
|
||||||
|
|
||||||
mod block_processing_benches;
|
mod block_processing_benches;
|
||||||
mod epoch_processing_benches;
|
mod epoch_processing_benches;
|
||||||
|
|
||||||
criterion_group!(
|
pub const VALIDATOR_COUNT: usize = 300_032;
|
||||||
benches,
|
|
||||||
epoch_processing_benches::epoch_processing_16k_validators,
|
pub fn state_processing(c: &mut Criterion) {
|
||||||
block_processing_benches::block_processing_16k_validators,
|
block_processing_benches::bench_block_processing_n_validators(c, VALIDATOR_COUNT);
|
||||||
);
|
epoch_processing_benches::bench_epoch_processing_n_validators(c, VALIDATOR_COUNT);
|
||||||
|
}
|
||||||
|
|
||||||
|
criterion_group!(benches, state_processing,);
|
||||||
criterion_main!(benches);
|
criterion_main!(benches);
|
||||||
|
@ -13,11 +13,9 @@ use types::test_utils::{TestingBeaconBlockBuilder, TestingBeaconStateBuilder};
|
|||||||
use types::*;
|
use types::*;
|
||||||
|
|
||||||
/// Run the benchmarking suite on a foundation spec with 16,384 validators.
|
/// Run the benchmarking suite on a foundation spec with 16,384 validators.
|
||||||
pub fn block_processing_16k_validators(c: &mut Criterion) {
|
pub fn bench_block_processing_n_validators(c: &mut Criterion, validator_count: usize) {
|
||||||
let spec = ChainSpec::foundation();
|
let spec = ChainSpec::foundation();
|
||||||
|
|
||||||
let validator_count = 300_032;
|
|
||||||
|
|
||||||
let (mut state, keypairs) = build_state(validator_count, &spec);
|
let (mut state, keypairs) = build_state(validator_count, &spec);
|
||||||
let block = build_block(&mut state, &keypairs, &spec);
|
let block = build_block(&mut state, &keypairs, &spec);
|
||||||
|
|
||||||
|
@ -17,11 +17,9 @@ pub const BENCHING_SAMPLE_SIZE: usize = 10;
|
|||||||
pub const SMALL_BENCHING_SAMPLE_SIZE: usize = 10;
|
pub const SMALL_BENCHING_SAMPLE_SIZE: usize = 10;
|
||||||
|
|
||||||
/// Run the benchmarking suite on a foundation spec with 16,384 validators.
|
/// Run the benchmarking suite on a foundation spec with 16,384 validators.
|
||||||
pub fn epoch_processing_16k_validators(c: &mut Criterion) {
|
pub fn bench_epoch_processing_n_validators(c: &mut Criterion, validator_count: usize) {
|
||||||
let spec = ChainSpec::foundation();
|
let spec = ChainSpec::foundation();
|
||||||
|
|
||||||
let validator_count = 300_032;
|
|
||||||
|
|
||||||
let mut builder = TestingBeaconStateBuilder::new(validator_count, &spec);
|
let mut builder = TestingBeaconStateBuilder::new(validator_count, &spec);
|
||||||
|
|
||||||
// Set the state to be just before an epoch transition.
|
// Set the state to be just before an epoch transition.
|
||||||
|
Loading…
Reference in New Issue
Block a user