diff --git a/v0-parameters/benches/benchmark.rs b/v0-parameters/benches/benchmark.rs index a57ef558c..b6431d7ef 100644 --- a/v0-parameters/benches/benchmark.rs +++ b/v0-parameters/benches/benchmark.rs @@ -1,7 +1,31 @@ use criterion::{black_box, criterion_group, criterion_main, Criterion}; use v0_parameters::{all_results, Args, MAX_LWE_DIM, MIN_LWE_DIM, _4_SIGMA}; -fn pbs_benchmark(c: &mut Criterion) { +fn v0_pbs_optimization(c: &mut Criterion) { + let args: Args = Args { + min_precision: 1, + max_precision: 8, + p_error: _4_SIGMA, + security_level: 128, + min_log_poly_size: 8, + max_log_poly_size: 16, + min_glwe_dim: 1, + max_glwe_dim: 1, + min_intern_lwe_dim: MIN_LWE_DIM, + max_intern_lwe_dim: MAX_LWE_DIM, + sum_size: 4096, + no_parallelize: true, + wop_pbs: false, + simulate_dag: false, + cache_on_disk: true, + }; + + c.bench_function("v0 PBS table generation", |b| { + b.iter(|| black_box(all_results(&args))) + }); +} + +fn v0_pbs_optimization_simulate_graph(c: &mut Criterion) { let args: Args = Args { min_precision: 1, max_precision: 8, @@ -20,12 +44,12 @@ fn pbs_benchmark(c: &mut Criterion) { cache_on_disk: true, }; - c.bench_function("PBS table generation", |b| { + c.bench_function("v0 PBS simulate dag table generation", |b| { b.iter(|| black_box(all_results(&args))) }); } -fn wop_pbs_benchmark(c: &mut Criterion) { +fn v0_wop_pbs_optimization(c: &mut Criterion) { let args = Args { min_precision: 1, max_precision: 16, @@ -44,10 +68,15 @@ fn wop_pbs_benchmark(c: &mut Criterion) { cache_on_disk: true, }; - c.bench_function("WoP-PBS table generation", |b| { + c.bench_function("v0 WoP-PBS table generation", |b| { b.iter(|| black_box(all_results(&args))) }); } -criterion_group!(benches, pbs_benchmark, wop_pbs_benchmark); +criterion_group!( + benches, + v0_pbs_optimization, + v0_pbs_optimization_simulate_graph, + v0_wop_pbs_optimization +); criterion_main!(benches);