bench: proving benchmarks + optimized dev builds (snarkvm-style profiles) - #55
Merged
Conversation
Devnode-backed benchmark for credits transfer_public/transfer_private and shield_swap swap/mint: times authorize, execute, prepare (inclusion paths), and prove separately, cold vs warm. Excluded from strict pyright like python/tests (imports the built extension + shield-swap fixture).
…g pass-through Without profile overrides maturin develop produced a genuinely unoptimized extension — proving benchmarked 6-10x slower than native snarkvm. Mirror snarkvm's own profiles (dev opt-level 3) in both crates so local builds are usable for perf work, and let build-both.sh forward flags (./build-both.sh --release).
iamalwaysuncomfortable
force-pushed
the
bench/proving
branch
from
July 15, 2026 13:22
c4a2e05 to
67397ca
Compare
kpandl
approved these changes
Jul 15, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
sdk/benchmarks/bench_proving.py— devnode-backed proving benchmarks. Times every phase of the write ladder separately —authorize(build + sign),execute(proof-free run),prepare(inclusion paths),prove(the SNARK) — forcredits.aleo/transfer_public,credits.aleo/transfer_private,shield_swap_v3.aleo/swap, andshield_swap_v3.aleo/mint, cold vs warm. Uses the shield-swap devnode fixture (proofless setup + real on-chain records, so inclusion proofs are real). Run:python sdk/benchmarks/bench_proving.py [--prove-iters N] [--json out.json].[profile.dev] opt-level = 3insdk/Cargo.tomlandsdk-abi/Cargo.toml(plus[profile.release]with thin LTO), mirroring snarkvm's own workspace profiles. Cargo profiles apply only from the root crate, so snarkvm's settings never reached us as a dependency —maturin developwas producing a genuinely unoptimized extension.build-both.shforwards extra flags (./build-both.sh --release).Why it matters
The unoptimized dev build was 6–15x slower on all crypto paths. Benchmark numbers on Apple Silicon (warm prove):
credits/transfer_publiccredits/transfer_privateshield_swap_v3/swapshield_swap_v3/mintThe profile fix also drops the main SDK test suite from 190 s to 30 s locally. Published wheels were never affected (CI always builds
--release); this was a local-dev-only trap.Verification
--json)