Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Benchmark: Proving with SP1

Determination of the expected proving speed (in TPS) for a given machine and configuration using the SP1 zkVM. This benchmark produces results with a tradeoff between proof latency and max throughput.

Setup

Before running the benchmark, make sure your machine is set up and ready to go. Refer to the Setup Guide for how to set everything up with dependencies.

Running

For CPU proving, run the benchmark with the following command:

cd benchmarks/zk-proving/sp1
RUSTFLAGS="-C target-cpu=native -C target-feature=+avx512f" cargo run --release

Note: The benchmark currently does not support GPU proving

Options

The following options are available:

Options:
      --num-accounts <NUM_ACCOUNTS>
          The number of accounts to fill the state trie (default: 1_000_000) [default: 1000000]
      --max-proof-duration <MAX_PROOF_DURATION>
          The maximum amount of proof generation time to target (default: 600 seconds) [default: 600]
  -h, --help
          Print help
  -V, --version
          Print version

Output

The benchmark outputs two tables. One lists the raw proving time and the number of transactions/events that were proven. The other lists estimated TPS values for a range of proof latencies.

Example:

Proof generation benchmark results:
Events  Time (s)        TPS
1       3.84    0.26
2       3.92    0.51
...
10000   566.03  17.67
20000   1021.02 19.59

Estimated TPS at various latencies:
Latency (s)     TPS
5       3.07
10      7.94
...
120     14.50
300     16.10

Benchmark Results

The following results were obtained on the various reference machines.

AWS c6i.8xlarge

Proof generation benchmark results:
Events  Time (s)        TPS
1       217.23  0.00
2       216.40  0.01
5       220.98  0.02
10      231.88  0.04
20      272.03  0.07
50      356.95  0.14
100     474.74  0.21
200     692.59  0.29
500     1333.82 0.37

Estimated TPS at various latencies:
Latency (s)     TPS
5       --
10      --
30      --
60      --
120     --
300     0.10