doc: add desktop zk benchmarks

This commit is contained in:
zero
2024-03-24 12:14:10 +01:00
parent baa0146834
commit ae0e8f6ff3
3 changed files with 40 additions and 0 deletions

View File

@@ -28,6 +28,7 @@
- [API Rustdoc](dev/rustdoc.md)
- [Native Contracts](dev/native_contracts.md)
- [Seminars](dev/seminars.md)
- [Benchmark](dev/bench.md)
- [Architecture](arch/arch.md)
- [Overview](arch/overview.md)
- [Anonymous assets](arch/anonymous_assets.md)

37
doc/src/dev/bench.md Normal file
View File

@@ -0,0 +1,37 @@
# ZK Circuits
Tested with `proof/arithmetic.zk`
## Desktop
```
Benchmarking k=11
Avg proving time: 375 ms
Avg verification time: 3 ms
Benchmarking k=12
Avg proving time: 588 ms
Avg verification time: 5 ms
Benchmarking k=13
Avg proving time: 965 ms
Avg verification time: 8 ms
Benchmarking k=14
Avg proving time: 1688 ms
Avg verification time: 13 ms
Benchmarking k=15
test bench_zk has been running for over 60 seconds
Avg proving time: 3038 ms
Avg verification time: 20 ms
Benchmarking k=16
Avg proving time: 6043 ms
Avg verification time: 35 ms
Benchmarking k=17
Avg proving time: 13297 ms
Avg verification time: 65 ms
Benchmarking k=18
Avg proving time: 26366 ms
Avg verification time: 122 ms
Benchmarking k=19
Avg proving time: 65233 ms
Avg verification time: 219 ms
```

View File

@@ -46,6 +46,8 @@ fn bench_zk() -> Result<()> {
let public_inputs = vec![a + b, a * b, a - b];
// I tried cargo bench, but there's no way to display k=X for each individual bench
// TODO: make a benchmark group and use bench_with_input (cargo bench)
// see https://github.com/getsentry/relay/blob/master/relay-cardinality/benches/redis_impl.rs#L137-L165
for k in 11..20 {
println!("Benchmarking k={}", k);