From 86de7718cc75635a33d1e9a9a9faff4f3868a828 Mon Sep 17 00:00:00 2001 From: Jaremy Creechley Date: Wed, 24 Apr 2024 17:28:53 +0300 Subject: [PATCH] benchmarks --- benchmarks/ark_prover_bench.nim | 8 +++++++- benchmarks/create_circuits.nim | 5 ++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/benchmarks/ark_prover_bench.nim b/benchmarks/ark_prover_bench.nim index 651cdd9a..379d59b2 100644 --- a/benchmarks/ark_prover_bench.nim +++ b/benchmarks/ark_prover_bench.nim @@ -69,7 +69,13 @@ proc runBenchmark(args: CircArgs) = inputData = inputs.readFile() inputJson = !JsonNode.parse(inputData) proofInputs = Poseidon2Hash.jsonToProofInput(inputJson) - circom = CircomCompat.init(r1cs, wasm, zkey) + circom = CircomCompat.init( + r1cs, + wasm, + zkey, + slotDepth = args.depth, + numSamples = args.nsamples, + ) defer: circom.release() # this comes from the rust FFI diff --git a/benchmarks/create_circuits.nim b/benchmarks/create_circuits.nim index 85678011..e325ca39 100644 --- a/benchmarks/create_circuits.nim +++ b/benchmarks/create_circuits.nim @@ -99,7 +99,10 @@ proc downloadPtau*(ptauPath, ptauUrl: string) = discard execShellCmd(fmt"curl -LOC - {ptauDefUrl}") proc getCircuitBenchPath*(args: CircArgs): string = - absolutePath("benchmarks/circuit_bench_" & $cast[uint](hash(args))) + var an = "" + for f, v in fieldPairs(args): + an &= "_" & f & $v + absolutePath("benchmarks/circuit_bench" & an) proc generateCircomAndSamples*(args: CircArgs, name: string) = ## run nim circuit and sample generator