Skip to content

Commit

Permalink
write benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
plafer committed Mar 14, 2024
1 parent 3c9c5ea commit cb7ecb3
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions prover/benches/lagrange_kernel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,47 @@
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

use std::time::Duration;

use air::{
Air, AirContext, Assertion, AuxTraceRandElements, ConstraintCompositionCoefficients,
EvaluationFrame, FieldExtension, ProofOptions, TraceInfo, TransitionConstraintDegree,
};
use criterion::{criterion_group, criterion_main, Criterion};
use criterion::{criterion_group, criterion_main, BatchSize, BenchmarkId, Criterion};
use crypto::{hashers::Blake3_256, DefaultRandomCoin};
use math::{fields::f64::BaseElement, ExtensionOf, FieldElement};
use winter_prover::{
matrix::ColMatrix, DefaultConstraintEvaluator, DefaultTraceLde, Prover, StarkDomain, Trace,
TracePolyTable,
};

fn prove_with_lagrange_kernel(c: &mut Criterion) {}
const TRACE_LENS: [usize; 3] = [2_usize.pow(14), 2_usize.pow(15), 2_usize.pow(16)];

fn prove_with_lagrange_kernel(c: &mut Criterion) {
let mut group = c.benchmark_group("Lagrange kernel column");
group.sample_size(10);
group.measurement_time(Duration::from_secs(20));

for &trace_len in TRACE_LENS.iter() {
group.bench_function(BenchmarkId::new("prover", trace_len), |b| {
let trace = LagrangeTrace::new(trace_len, 2);
let prover = LagrangeProver::new();
b.iter_batched(
|| trace.clone(),
|trace| prover.prove(trace).unwrap(),
BatchSize::SmallInput,
)
});
}
}

criterion_group!(lagrange_kernel_group, prove_with_lagrange_kernel);
criterion_main!(lagrange_kernel_group);

// TRACE
// =================================================================================================

#[derive(Clone, Debug)]
struct LagrangeTrace {
// dummy main trace
main_trace: ColMatrix<BaseElement>,
Expand Down

0 comments on commit cb7ecb3

Please sign in to comment.