Skip to content

Commit

Permalink
Ligero fix benches (#40)
Browse files Browse the repository at this point in the history
* fix bench call

* set num vars from 12-20
  • Loading branch information
mmagician authored Nov 13, 2023
1 parent 25c34aa commit 370e77c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion bench-templates/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@ pub fn bench_pcs_method<
BenchmarkId::from_parameter(num_vars),
&num_vars,
|b, num_vars| {
b.iter(|| method(&ck, &vk, *num_vars, rand_poly, rand_point));
b.iter_custom(|i| {
let mut time = Duration::from_nanos(0);
for _ in 0..i {
time += method(&ck, &vk, *num_vars, rand_poly, rand_point);
}
time
});
},
);
}
Expand Down
4 changes: 2 additions & 2 deletions poly-commit/benches/ligero_ml_times.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fn rand_point_ligero_ml<F: PrimeField>(num_vars: usize, rng: &mut ChaCha20Rng) -
(0..num_vars).map(|_| F::rand(rng)).collect()
}

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

bench!(Ligero<Fr>, rand_poly_ligero_ml, rand_point_ligero_ml);

0 comments on commit 370e77c

Please sign in to comment.