Usage
Arguments
Replay file path (
.crd).If a filename is provided without path, also searches base-dir/replays/Options
Number of measured benchmark runs.Default:
- headless: 5
- render: 1
Warmup runs before measured timing.Default:
- headless: 1
- render: 0
Benchmark mode:
headless— Simulation only (no rendering)render— Full rendering pipeline
Enable non-canonical RTX render mode.Render mode only.
Stop after N ticks.Default: Full replay
Enable replay RNG trace mode during simulation.
Run one cProfile pass and include hotspot summary.
Hotspot sort key:
cumtime— Cumulative time (includes subcalls)tottime— Total time (function only)
Maximum hotspot rows to include.Must be ≥ 1.
Optional cProfile .pstats output path.Used only with
--profile.Collect per-tick render telemetry.Render mode only. Records frame timing, draw calls, pass breakdown.
Optional output path for full render telemetry JSON.Render mode only.
Optional output directory for render telemetry SVG charts.Render mode only. Requires
altair package.Output format:
human— Human-readable textjson— Machine-readable JSON
Optional JSON output path for benchmark payload.
Base path for runtime files.Default: Per-user OS data directory
Alias for
--base-dir.Output Format
Human Format (default)
JSON Format
_ReplayBenchmarkPayload (source:cli/replay.py:389).
Metrics
Wall-clock milliseconds per run.
Simulation throughput (ticks/sec).Higher = better performance.Target: ~60 tps = 1x realtime
Realtime multiplier.
1.0x= realtime10.0x= 10x faster than realtime0.5x= 2x slower than realtime
min, p50, mean, p95, max, stdev.
Examples
Basic Headless Benchmark
Single Run
Render Mode Benchmark
With Profiling
Render Telemetry
telemetry.json— Per-frame timing datacharts/frame_timing.svg— Frame timing chartcharts/draw_calls.svg— Draw call chartcharts/pass_timing_stacked.svg— Render pass breakdowncharts/report.md— Summary report
JSON Output
Short Replay Segment
Profiling
With--profile, runs one extra profiled pass using Python’s cProfile:
Render Telemetry
With--render-telemetry, collects per-frame metrics:
Total frame time (update + draw).
Simulation update time.
Rendering time.
Total draw calls per frame.
Draw calls grouped by raylib API.
Draw calls grouped by render pass.
Time spent in each render pass.
Charts
With--render-charts-out-dir, generates SVG visualizations:
frame_timing.svg— Frame time over ticksdraw_calls.svg— Draw call count over tickspass_timing_stacked.svg— Stacked pass timingreport.md— Markdown summary
Performance Tips
Headless vs Render
Headless is 10-20x faster:Reducing Variance
For stable benchmarks:- Close background apps
- Use
--runs 10for better statistics - Use
--warmup-runs 2to warm caches - Run on AC power (laptops)
Short Replays
For quick iteration:Use Cases
Regression Testing
Detect performance regressions:Profiling Bottlenecks
Render Optimization
- Frame spikes
- Draw call bottlenecks
- Expensive render passes
CI Performance Tracking
See Also
- replay verify — Headless verification
- replay render — Video rendering
- Replay System — Overview