Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Incorrect aggregation of KZG benchmark results #409

Merged
merged 6 commits into from
Jan 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions primitives/benches/pcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ use jf_primitives::pcs::{
};
use jf_utils::test_rng;

const MIN_NUM_VARS: usize = 10;
const MAX_NUM_VARS: usize = 20;
const MIN_NUM_VARS: usize = 12;
const MAX_NUM_VARS: usize = 22;

/// Measure the time cost of {commit/open/verify} across a range of num_vars
pub fn bench_pcs_method<E: Pairing>(
Expand All @@ -39,7 +39,15 @@ pub fn bench_pcs_method<E: Pairing>(
BenchmarkId::from_parameter(num_vars),
&num_vars,
|b, num_vars| {
b.iter(|| method(&pp, *num_vars));
// `iter` ignores the result of the function call (i.e. the time), so we need
// `iter_custom`, otherwise the PCS setup is included in the measurements.
b.iter_custom(|i| {
mrain marked this conversation as resolved.
Show resolved Hide resolved
let mut time = Duration::from_nanos(0);
for _ in 0..i {
time += method(&pp, *num_vars);
}
time
});
},
);
}
Expand Down
Loading