Skip to content

Latest commit

 

History

History

kimchi

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Kimchi

Kimchi is based on PlonK, a zk-SNARK protocol.

Benchmarks

To bench kimchi, we have two types of benchmark engines.

Criterion is used to benchmark time. If you have installed cargo-criterion and gnuplot, you can run the benchmarks via

$ cargo criterion -p kimchi --bench proof_criterion

The result will appear in target/criterion/single\ proof/report/index.html and look like this:

criterion kimchi

Note that it only does 10 passes. To have more accurate statistics, remove the .sample_size(10) line from the bench.

The other benchmark uses iai to perform precise one-shot benchmarking. This is useful in CI, for example, where typical benchmarks are affected by the load of the host running CI.

$ cargo bench -p kimchi --bench proof_iai

It will look like this:

bench_proof_creation
Instructions: 22045968746
L1 Accesses: 27210681906
L2 Accesses: 32019515
RAM Accesses: 3034134
Estimated Cycles: 27476974171

Flamegraph

To obtain a flamegraph:

  1. install required dependencies based on your OS
  2. install cargo-flamegraph:
    $ cargo install flamegraph
  3. run cargo flamegraph with sudo (or with the option --root on mac):
    $ # flamegraph of the proof creation:
    $ CARGO_PROFILE_RELEASE_DEBUG=true cargo flamegraph --bin flamegraph --notes "proof creation" -- prove
    $ # flamegraph of the proof verification:
    $ CARGO_PROFILE_RELEASE_DEBUG=true cargo flamegraph --bin flamegraph --notes "proof verification" -- verify
    the binary will run forever, so you have to C-c to exit and produce the flamegraph.svg file.

Note: lots of good advice on system performance in the flamegraph repo.