Skip to content

Commit

Permalink
Merge branch 'v0.7' into feat/inv_bench
Browse files Browse the repository at this point in the history
  • Loading branch information
z2trillion authored and Mason Liang committed Nov 27, 2023
2 parents 50df84f + 9325879 commit 50f428b
Show file tree
Hide file tree
Showing 11 changed files with 80,235 additions and 70 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,13 @@ jobs:
toolchain: nightly-2022-12-10
override: true
- run: make test
bench:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2022-12-10
override: true
- run: make bench
10 changes: 7 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ num-bigint = "0.4"
hex = "0.4"
thiserror = "1.0"
log = "0.4"
criterion = { version = "0.4", optional = true}
env_logger = "0.9.0"
mpt-zktrie = { git = "https://github.com/scroll-tech/zkevm-circuits.git", rev = "7d9bc181953cfc6e7baf82ff0ce651281fd70a8a" }
rand_chacha = "0.3.0"
env_logger = "0.9.0"
criterion = { version = "0.4", optional = true}

[patch."https://github.com/privacy-scaling-explorations/halo2.git"]
halo2_proofs = { git = "https://github.com/scroll-tech/halo2.git", branch = "develop" }
Expand All @@ -39,7 +39,6 @@ default = ["halo2_proofs/mock-batch-inv"]

[dev-dependencies]
# mpt-zktrie = { path = "../scroll-circuits/zktrie" }
rand_chacha = "0.3.0"
plotters = "0.3"
bencher = "0.1"
subtle = "2"
Expand All @@ -51,3 +50,8 @@ path = "integration-tests/src/main.rs"
[profile.test]
opt-level = 3
debug-assertions = true

[[bench]]
name = "parallel_assignment"
harness = false
required-features = [ "bench" ]
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ fmt:
@cargo fmt

clippy:
@cargo clippy --all-features -- -D warnings
@cargo clippy --all-features

bench:
@cargo bench --features bench
20 changes: 20 additions & 0 deletions benches/parallel_assignment.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
use criterion::{criterion_group, criterion_main, Criterion};
use halo2_mpt_circuits::TestCircuit;
use halo2_proofs::{dev::MockProver, halo2curves::bn256::Fr};

fn bench(criterion: &mut Criterion) {
let json = include_str!("traces.json");
let circuit = TestCircuit::new(10_000, serde_json::from_str(&json).unwrap());

criterion.bench_function("assign trace", |bencher| {
bencher.iter(|| MockProver::<Fr>::run(14, &circuit, vec![]))
});
}

criterion_group! {
name = benches;
config = Criterion::default().sample_size(10);
targets = bench
}

criterion_main!(benches);
Loading

0 comments on commit 50f428b

Please sign in to comment.