Execution Profiling
Jolt uses tokio-rs/tracing for execution profiling, allowing you to generate detailed traces of your program’s execution.Basic Trace Generation
To generate an execution trace, run:--name parameter accepts the following benchmark programs:
sha2sha3sha2-chainfibonaccibtreemap
examples directory. Benchmark inputs are provided in bench.rs.
This command outputs a JSON file in the workspace root with the name trace-<timestamp>.json, which can be viewed in Perfetto.
CPU and Memory Monitoring
To track CPU and memory usage alongside your execution trace, use themonitor feature:
The monitor feature provides real-time insights into resource consumption during proving, which is especially useful for identifying bottlenecks.
CPU Profiling with pprof
For detailed CPU profiling, enable thepprof feature:
.pb profile file that can be viewed using pprof:
Memory Profiling
Jolt uses allocative for memory profiling, allowing you to measure the total heap space occupied by data structures and generate flamegraphs.Generating Memory Profiles
Most sumcheck data structures in Jolt implement theAllocative trait. Flamegraphs are generated at the start and end of stages 2-5 (see jolt_dag.rs).
To generate allocative output:
--name parameter accepts the same benchmark programs as execution profiling:
sha2sha3sha2-chainfibonaccibtreemap
Understanding the Output
The command will:- Log memory usage information to the command line
- Output multiple SVG files (e.g.,
stage3_start_flamechart.svg) - Generate flamegraphs that can be viewed in any web browser
Memory flamegraphs provide a visual representation of heap allocations, making it easy to identify memory-intensive data structures.