Expand description
End-to-end prover memory profile.
Proves either the canonical benchmark circuit (kimchi::bench::BenchmarkCtx)
or a serialised mina circuit fixture (the same kimchi_inputs_*.ser files
the proof_criterion_mina bench consumes) under a counting global
allocator and reports, for the proof-creation window: total bytes
allocated, allocation count, peak live bytes (and its delta over the bytes
live when the window opened), plus jemallocβs peak resident set sampled by
a background thread. The process exists for this one measurement, so the
counters are exact for a deterministic workload β a single run is the
answer.
Usage:
cargo run --release -p kimchi --bin memory_profile --features diagnostics -- synthetic [--srs-log2 16]
cargo run --release -p kimchi --bin memory_profile --features diagnostics -- fixture <kimchi_inputs_CURVE_SEED.ser>synthetic proves the benchmark circuit at the given domain/SRS size;
fixture proves a mina fixture, whose curve and seed are parsed from the
filename exactly as in proof_criterion_mina. Output is a single JSON
object on stdout (byte counts, not MB), meant to be collected across
fixtures and diffed against a baseline run β see
scripts/memory-profile-mina-circuits.sh and
scripts/memory-profile-diff.py.
One fixture per invocation: jemalloc retains pages across proofs, so
peak_resident is only trustworthy for the first proof in a process.
The resident-set sampler interval is KIMCHI_MEMORY_PROFILE_SAMPLE_MS
(default 25).
ModulesΒ§
- counting_
alloc π - mem_
profile π - An allocation profile over a window of execution.
StructsΒ§
- Fixture π
- A serialised mina circuit fixture, addressed by the filename convention
kimchi_inputs_CURVE_SEED.serthatproof_criterion_minaalso uses. - Report π
- One profiled proof, as the JSON object written to stdout.
EnumsΒ§
- Cli π
FunctionsΒ§
- main π
- profile_
fixture_ πcurve - profile_
mina_ πfixture - profile_
synthetic π