diff --git a/benches/groups.rs b/benches/groups.rs index 5d2b22b37..87c80d029 100644 --- a/benches/groups.rs +++ b/benches/groups.rs @@ -14,6 +14,18 @@ fn criterion_benchmark(c: &mut Criterion) { c.bench_function("full pairing", move |b| { b.iter(|| pairing(black_box(&g), black_box(&h))) }); + c.bench_function("G2 preparation for pairing", move |b| { + b.iter(|| G2Prepared::from(h)) + }); + let prep = G2Prepared::from(h); + c.bench_function("miller loop for pairing", move |b| { + b.iter(|| multi_miller_loop(&[(&g, &prep)])) + }); + let prep = G2Prepared::from(h); + let r = multi_miller_loop(&[(&g, &prep)]); + c.bench_function("final exponentiation for pairing", move |b| { + b.iter(|| r.final_exponentiation()) + }); } // G1Affine {