Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/risc0/risc0/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Performance benchmarking is crucial for understanding the efficiency of your zkVM applications. RISC Zero provides tools to measure execution time, throughput, and cycle counts across different hardware configurations.

Generating Your Own Datasheet

You can generate a datasheet to get performance data for your exact system, or to benchmark a different RISC Zero zkVM version.

Prerequisites

First, install Rust and the RISC Zero toolchain, then clone the risc0 repository:
git clone https://github.com/risc0/risc0
cd risc0

CPU Benchmarking

To generate benchmark data for CPU proving:
cargo run --release --example datasheet
This produces benchmark data for your system using the CPU on the checked-out version of the RISC Zero zkVM.

GPU Benchmarking

To benchmark GPU performance, build with the appropriate feature flag:
cargo run --release -F metal --example datasheet
GPU proving is enabled by default on macOS. For CUDA, ensure you have the appropriate NVIDIA drivers and CUDA toolkit installed.

Fibonacci Benchmark

The Fibonacci benchmark provides a simple way to measure execution and proving performance:
cargo bench --bench fib
This computes the 100th, 1000th, and 10,000th Fibonacci numbers modulo 2^64, running each computation ten times. The benchmark reports:
  • Time: Total time taken for execution and proving
  • Throughput: Operations per second during execution and proving
  • Separate statistics: For both execution and proving
Use feature flags (-F cuda or -F metal) to benchmark GPU performance with the Fibonacci benchmark as well.

Understanding Performance Metrics

Cycle Counts

The zkVM measures computation complexity in clock cycles. Each cycle typically corresponds to a single RISC-V operation, though some operations require two cycles. Key metrics:
  • Total cycles: All cycles including system overhead
  • User cycles: Cycles spent executing your guest code
  • Segments: Number of proof segments generated

Profiling Your Application

For detailed profiling information, set the RISC0_INFO=1 environment variable:
RISC0_INFO=1 cargo run --release
This provides profiling data showing where cycles are spent in your guest program.
For comprehensive profiling guidance, see the Profiling Guide.

Performance Optimization

Hardware Acceleration

RISC Zero supports hardware acceleration through:
  1. GPU proving: Use CUDA or Metal backends for faster proof generation
  2. Precompiles: Optimized circuits for common operations like SHA-256, BigInt arithmetic, Keccak, and ECDSA

Best Practices

  • Use precompiles for cryptographic operations when available
  • Minimize guest program complexity by offloading untrusted computation to the host
  • Profile regularly to identify bottlenecks
  • Consider proof composition to split large computations
Performance characteristics can vary significantly based on:
  • Hardware configuration (CPU, GPU, RAM)
  • zkVM version
  • Guest program structure
  • Proof compression level (composite, succinct, compact)

Performance Reports

For official benchmark reports and comparison data, visit: https://reports.risczero.com/benchmarks This site provides:
  • Prover benchmarks across different hardware
  • Application benchmarks for common use cases
  • Supported crates and their performance characteristics

Next Steps

Optimization Guide

Learn how to optimize your zkVM applications

Profiling

Profile your guest code to find bottlenecks

Precompiles

Use accelerated circuits for common operations

Examples

Explore example applications with benchmarks