Skip to content
Riot Docs

Search is only available in production builds. Try building and previewing the site to test it out locally.

Install Riot GitHub

riot bench

riot bench is the workspace entrypoint for benchmarks.

The simplest form runs every discovered benchmark suite:

Terminal window
riot bench

That makes benchmark execution feel like part of the same toolchain as riot test, not a separate ritual.

Like riot test, riot bench supports both package-level narrowing and query filtering.

Run only one package:

Terminal window
riot bench -p std

Run only matching benchmark names or suites:

Terminal window
riot bench hashmap

This matters because benchmarks often get expensive before they get numerous.

Use JSON mode when a program, not a human, is the primary consumer:

Terminal window
riot bench --json

This emits machine-readable JSONL benchmark events rather than terminal prose. Use it for:

  • CI performance checks
  • dashboards
  • editor integrations
  • regression tracking tools

If a benchmark binary writes useful stdout or stderr, increase verbosity:

Terminal window
riot bench -v

Default output should stay compact enough to scan. Verbose mode is how you opt into additional suite output without making every run noisy.

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?

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-benchmarks
  • list-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.