Skip to content

Commit

Permalink
Add test bench & enable internal tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
volhovm committed Jan 29, 2025
1 parent c0a9b94 commit a8e8168
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kimchi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ groupmap.workspace = true
mina-curves.workspace = true
o1-utils.workspace = true
mina-poseidon.workspace = true
criterion.workspace = true


[dev-dependencies]
Expand Down Expand Up @@ -79,7 +80,7 @@ name = "amortization"
harness = false

[features]
default = []
default = ["internal_tracing"]
internal_tracing = ["internal-tracing/enabled"]
ocaml_types = [
"ocaml",
Expand Down
31 changes: 31 additions & 0 deletions kimchi/src/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,34 @@ impl BenchmarkCtx {
.unwrap();
}
}

#[cfg(test)]
mod tests {

use super::*;

#[test]
fn test_prover_bench() {
let mut ctx = BenchmarkCtx::new(16);

ctx.index.compute_verifier_index_digest::<BaseSponge>();
use poly_commitment::SRS;
ctx.index.srs.get_lagrange_basis(ctx.index.cs.domain.d1);

// Sleep 2 sec to clearly show where the comp starts
std::thread::sleep(std::time::Duration::from_millis(1500));

//use crate::prover::internal_traces;
//internal_traces::start_tracing();
println!(
"proof creation (SRS size 2^{{{}}}, {} gates)",
ctx.srs_size(),
ctx.num_gates
);
for _i in 0..10 {
ctx.create_proof();
}
//let traces = internal_traces::take_traces();
//println!("traces: {:?}", traces);
}
}

0 comments on commit a8e8168

Please sign in to comment.