riot bench
riot bench is the workspace entrypoint for benchmarks.
The simplest form runs every discovered benchmark suite:
riot benchThat makes benchmark execution feel like part of the same toolchain as riot test, not a separate
ritual.
Filtering what runs
Section titled “Filtering what runs”Like riot test, riot bench supports both package-level narrowing and query filtering.
Run only one package:
riot bench -p stdRun only matching benchmark names or suites:
riot bench hashmapThis matters because benchmarks often get expensive before they get numerous.
JSON output
Section titled “JSON output”Use JSON mode when a program, not a human, is the primary consumer:
riot bench --jsonThis emits machine-readable JSONL benchmark events rather than terminal prose. Use it for:
- CI performance checks
- dashboards
- editor integrations
- regression tracking tools
Verbose mode
Section titled “Verbose mode”If a benchmark binary writes useful stdout or stderr, increase verbosity:
riot bench -vDefault output should stay compact enough to scan. Verbose mode is how you opt into additional suite output without making every run noisy.
What the human output includes
Section titled “What the human output includes”For completed cases, Riot reports:
- iterations
- mean
- median
- min
- max
- standard deviation
For comparisons, it also reports:
- the fastest case
- per-case statistics
- relative speed ratios
That is enough to answer the important question: did the code get faster, slower, or stay roughly the same?
Benchmark binaries
Section titled “Benchmark binaries”Under the hood, suite binaries are expected to support the shared benchmark CLI contract through
Std.Bench.Cli.main.
That contract includes support for commands such as:
run-benchmarkslist-benchmarks
and options like:
--format--iterations--warmup
The point is the same as with tests: Riot can orchestrate many benchmark suites because each suite speaks the same binary contract.