Skip to content

Commit

Permalink
CriterionHelpers: Adding const sample_size and measuremen_time
Browse files Browse the repository at this point in the history
  • Loading branch information
rrtoledo committed Jan 17, 2025
1 parent bd21a68 commit 4f353a3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion benches/centralized_telescope/number_steps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ fn step_benches(c: &mut Criterion<Steps>) {
mod criterion_group {
#![allow(missing_docs)]
use super::{criterion_group, step_benches, Criterion, Duration, Steps};
use crate::utils::common::criterion_helpers::{MEASUREMENT_TIME_SEC, SAMPLE_SIZE};

criterion_group!(name = centralized_step;
config = Criterion::default().with_measurement(Steps).measurement_time(Duration::from_secs(30)).sample_size(200);
config = Criterion::default().with_measurement(Steps).measurement_time(Duration::from_secs(MEASUREMENT_TIME_SEC)).sample_size(SAMPLE_SIZE);
targets = step_benches
);
}
Expand Down
3 changes: 2 additions & 1 deletion benches/centralized_telescope/proving_time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ fn proving_benches(c: &mut Criterion) {
mod criterion_group {
#![allow(missing_docs)]
use super::{criterion_group, proving_benches, Criterion, Duration};
use crate::utils::common::criterion_helpers::{MEASUREMENT_TIME_SEC, SAMPLE_SIZE};

criterion_group!(name = centralized_proving_time;
config = Criterion::default().measurement_time(Duration::from_secs(30)).sample_size(200);
config = Criterion::default().measurement_time(Duration::from_secs(MEASUREMENT_TIME_SEC)).sample_size(SAMPLE_SIZE);
targets = proving_benches
);
}
Expand Down
3 changes: 2 additions & 1 deletion benches/centralized_telescope/verifying_time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ fn verify_benches(c: &mut Criterion) {
mod criterion_group {
#![allow(missing_docs)]
use super::{criterion_group, verify_benches, Criterion, Duration};
use crate::utils::common::criterion_helpers::{MEASUREMENT_TIME_SEC, SAMPLE_SIZE};

criterion_group!(name = centralized_verifying_time;
config = Criterion::default().measurement_time(Duration::from_secs(30)).sample_size(200);
config = Criterion::default().measurement_time(Duration::from_secs(MEASUREMENT_TIME_SEC)).sample_size(SAMPLE_SIZE);
targets = verify_benches
);
}
Expand Down
3 changes: 3 additions & 0 deletions benches/common/criterion_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ use criterion::{
BenchmarkId, Criterion, Throughput,
};

pub const SAMPLE_SIZE: usize = 200;

pub const MEASUREMENT_TIME_SEC: u64 = 30;
pub mod centralized {
use super::{BenchmarkId, Criterion, Measurement};
/// Benchmark parameters
Expand Down

0 comments on commit 4f353a3

Please sign in to comment.