benchmarks

This commit is contained in:
Jaremy Creechley 2024-04-24 17:28:53 +03:00
parent 234287d4b5
commit 86de7718cc
No known key found for this signature in database
GPG Key ID: 4E66FB67B21D3300
2 changed files with 11 additions and 2 deletions

View File

@ -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

View File

@ -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