Skip to content

Commit

Permalink
Revert "black box field benches"
Browse files Browse the repository at this point in the history
This reverts commit 8eae119.
oops
  • Loading branch information
PatStiles committed Oct 6, 2023
1 parent f20e3c7 commit 1482330
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions math/benches/criterion_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ use lambdaworks_math::{
field::fields::{
fft_friendly::{
stark_252_prime_field::{MontgomeryConfigStark252PrimeField, Stark252PrimeField},
u64_mersenne_montgomery_field::{
Mersenne31MontgomeryPrimeField, MontgomeryConfigMersenne31PrimeField,
},
u64_mersenne_montgomery_field::{MontgomeryConfigMersenne31PrimeField, Mersenne31MontgomeryPrimeField},
},
montgomery_backed_prime_fields::IsModulus,
},
Expand Down Expand Up @@ -187,12 +185,13 @@ pub fn u64_mersenne_montgomery_field_ops_benchmarks(c: &mut Criterion) {
group.bench_with_input("bitxor", &(x, y), |bench, (&x, &y)| {
bench.iter(|| black_box(black_box(x) ^ black_box(y)));
});

}

pub fn mersenne31_field_ops_benchmark(c: &mut Criterion) {
let mut group = c.benchmark_group("Mersenne31 operations");
let (x, y) = u32_utils::get_field_elements();

group.bench_with_input("add", &(x, y), |bench, (x, y)| {
bench.iter(|| black_box(black_box(x) + black_box(y)));
});
Expand All @@ -203,7 +202,7 @@ pub fn mersenne31_field_ops_benchmark(c: &mut Criterion) {

group.bench_with_input("pow by 1", &x, |bench, x| {
bench.iter(|| black_box(black_box(x).pow(black_box(1_u64))));
});
});

group.bench_with_input("square", &x, |bench, x| {
bench.iter(|| black_box(black_box(x).square()));
Expand Down Expand Up @@ -265,9 +264,9 @@ pub fn mersenne31_field_ops_benchmark(c: &mut Criterion) {
}

criterion_group!(
field_benches,
starkfp,
starkfield_ops_benchmarks,
u64_mersenne_montgomery_field_ops_benchmarks,
mersenne31_field_ops_benchmark
);
criterion_main!(field_benches);
criterion_main!(starkfp);

0 comments on commit 1482330

Please sign in to comment.