This repository contains GitHub Actions workflows for running ZKRust benchmarks on various instance sizes using runs-on.com.
The benchmarks can be run through the GitHub Actions interface:
- Navigate to the "Actions" tab in the repository
- Select the "Run Benchmarks" workflow
- Click "Run workflow"
- Fill in the following parameters:
Choose which AWS instance families to benchmark (comma-separated):
c7i: Latest generation Intel compute optimizedc7a: Latest generation AMD compute optimizedm7i: Latest generation Intel general purposem7a: Latest generation AMD general purpose
Default: c7i,c7a
Specify which CPU sizes to benchmark (comma-separated). Available sizes:
8: 8 CPU cores16: 16 CPU cores32: 32 CPU cores64: 64 CPU cores (default)96: 96 CPU cores (where available)
For example:
64(default): Only run on 64 CPU instances32,64: Run on both 32 and 64 CPU instances8,16,32,64,96: Run on all available CPU sizes
The workflow will run benchmarks on each CPU size for each selected family. For example, with:
- Instance Families:
c7i,m7i - CPU Sizes:
32,64
The workflow will benchmark:
- c7i: 32 and 64 CPU variants
- m7i: 32 and 64 CPU variants
All instances use spot pricing for cost efficiency.
Specify which version of the zkRust image to use (e.g., latest, v1.0.0). Images are pulled from ghcr.io/prooflabdev/zkrust. Defaults to main.
Enter a comma-separated list of programs to benchmark. Available programs:
fibonacci: Fibonacci sequence computationrsa: RSA encryption/decryptionecdsa: Elliptic Curve Digital Signature Algorithmjson: JSON parsing and validationregex: Regular expression matchingsha: SHA hash computationtendermint: Tendermint consensuszkquiz: ZK Quiz applicationbubble_sort: Bubble sort algorithmiseven: Simple even number check (SP1 only)
Example: fibonacci,rsa,ecdsa
Select the proving system to use:
sp1: SP1 proverrisc0: RISC0 prover
Enable or disable Rust caching:
true: Cache Rust dependencies between runs (faster subsequent runs)false: Clean build every time (useful for clean benchmarks)
After the workflow completes:
- Go to the workflow run
- Download the "benchmark-results" artifact
- The telemetry data will be in the downloaded zip file
- Uses runs-on.com for dynamic instance provisioning
- Mounts cargo cache volumes when caching is enabled
- Pulls images from GitHub Container Registry
- Stores results in the telemetry directory
- Uses compute-optimized instances for better performance
- Leverages spot instances for cost optimization
- Uses host networking for optimal network performance
To benchmark fibonacci and RSA on SP1 with a 16-core instance:
- Select
16cpu-linux-x64as Instance Type - Enter
fibonacci,rsain Programs - Select
sp1as Prover - Choose whether to use caching
- Click "Run workflow"
- The iseven program is only available for the SP1 prover
- Larger instance types will generally complete faster but cost more
- Using cache can significantly speed up subsequent runs but may affect benchmark accuracy
- All benchmarks are run with telemetry enabled