From 4ab743105903d88bd882701415b7e6ac90e3c5b4 Mon Sep 17 00:00:00 2001 From: Pratyush Mishra Date: Thu, 10 Dec 2020 17:00:23 -0800 Subject: [PATCH] Reduce number of samples --- curve-benches/src/macros/ec.rs | 11 +++++++++-- curve-benches/src/macros/pairing.rs | 9 ++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/curve-benches/src/macros/ec.rs b/curve-benches/src/macros/ec.rs index 38a3033..7b88312 100644 --- a/curve-benches/src/macros/ec.rs +++ b/curve-benches/src/macros/ec.rs @@ -2,7 +2,7 @@ macro_rules! ec_bench { ($projective:ty, $affine:ty) => { fn bench_curve(c: &mut $crate::criterion::Criterion) { - let mut group = c.benchmark_group(core::stringify!($projective)); + let mut group = c.benchmark_group("Group operation benchmarks for ".to_string() + core::stringify!($projective)); group.bench_function("Rand", rand); group.bench_function("MulAssign", mul_assign); group.bench_function("AddAssign", add_assign); @@ -199,6 +199,13 @@ macro_rules! ec_bench { }); } - $crate::criterion::criterion_group!(group_ops, bench_curve); + $crate::criterion::criterion_group!( + name = group_ops; + config = $crate::criterion::Criterion::default() + .sample_size(10) + .warm_up_time(core::time::Duration::from_millis(500)) + .measurement_time(core::time::Duration::from_secs(1)); + targets = bench_curve, + ); }; } diff --git a/curve-benches/src/macros/pairing.rs b/curve-benches/src/macros/pairing.rs index bfad660..de4edeb 100644 --- a/curve-benches/src/macros/pairing.rs +++ b/curve-benches/src/macros/pairing.rs @@ -73,6 +73,13 @@ macro_rules! pairing_bench { }); } - $crate::criterion::criterion_group!(pairing, bench_pairing); + $crate::criterion::criterion_group!( + name = pairing; + config = $crate::criterion::Criterion::default() + .sample_size(10) + .warm_up_time(core::time::Duration::from_millis(500)) + .measurement_time(core::time::Duration::from_secs(1)); + targets = bench_pairing, + ); } }