-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mason Liang
committed
Nov 14, 2023
1 parent
a61b269
commit 818cc3d
Showing
8 changed files
with
80,396 additions
and
121 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
use criterion::{black_box, criterion_group, criterion_main, Criterion}; | ||
use halo2_mpt_circuits::MPTProofType; | ||
use halo2_mpt_circuits::{ | ||
gadgets::poseidon::PoseidonTable, serde::SMTTrace, tests::TestCircuit, MptCircuitConfig, | ||
}; | ||
use halo2_proofs::dev::MockProver; | ||
use halo2_proofs::halo2curves::bn256::{Bn256, Fr}; | ||
use halo2_proofs::plonk::ConstraintSystem; | ||
use halo2_proofs::plonk::FirstPhase; | ||
|
||
fn bench(c: &mut Criterion) { | ||
let json = include_str!("traces.json"); | ||
let witness: Vec<(MPTProofType, SMTTrace)> = serde_json::from_str(&json).unwrap(); | ||
let circuit = TestCircuit::new(10_000, witness); | ||
|
||
c.bench_function("assign trace", |b| { | ||
b.iter(|| MockProver::<Fr>::run(14, &circuit, vec![])) | ||
}); | ||
} | ||
|
||
// fn criterion_benchmark(c: &mut Criterion) { | ||
// let json = include_str!("traces.json"); | ||
// let trace: SMTTrace = serde_json::from_str(&json).unwrap(); | ||
|
||
// let mut cs = ConstraintSystem::default(); | ||
// let poseidon = PoseidonTable::configure(&mut cs); | ||
// let challenge = cs.challenge_usable_after(FirstPhase); | ||
// let mpt = MptCircuitConfig::configure(&mut cs, challenge, &poseidon); | ||
|
||
// c.bench_function("assign trace", |b| b.iter(|| mpt.assign((black_box(20)))); | ||
// } | ||
|
||
criterion_group! { | ||
name = benches; | ||
config = Criterion::default().sample_size(10); | ||
targets = bench | ||
} | ||
|
||
criterion_main!(benches); |
Oops, something went wrong.