Skip to content

Commit 0f56fc9

Browse files
committed
chore: add fast_mul benchmark
1 parent 2ad4d1d commit 0f56fc9

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

crates/math/benches/polynomials/polynomial.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,25 @@ pub fn polynomial_benchmarks(c: &mut Criterion) {
4444
let y_poly = rand_poly(order);
4545
bench.iter(|| black_box(&x_poly) * black_box(&y_poly));
4646
});
47+
group.bench_function("fast mul", |bench| {
48+
let x_poly = rand_complex_mersenne_poly(order as u32);
49+
let y_poly = rand_complex_mersenne_poly(order as u32);
50+
bench.iter(|| black_box(&x_poly) * black_box(&y_poly));
51+
});
52+
53+
let big_order = 9;
54+
let x_poly = rand_complex_mersenne_poly(big_order);
55+
let y_poly = rand_complex_mersenne_poly(big_order);
56+
group.bench_function("fast_mul big poly", |bench| {
57+
bench.iter(|| {
58+
black_box(&x_poly)
59+
.fast_multiplication::<Degree2ExtensionField>(black_box(&y_poly))
60+
.unwrap()
61+
});
62+
});
63+
group.bench_function("slow mul big poly", |bench| {
64+
bench.iter(|| black_box(&x_poly) * black_box(&y_poly));
65+
});
4766

4867
let big_order = 9;
4968
let x_poly = rand_complex_mersenne_poly(big_order);

0 commit comments

Comments
 (0)