Skip to main content

Documentation Index

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

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

raiku bench provides a consistent interface for running benchmarks against any installed Raiku package, regardless of language. It resolves the package’s cache directory, auto-detects the appropriate benchmarking tool for the package’s language, and streams the results directly to your terminal. For Python packages, raiku bench also performs a file-based discovery step — scanning src/ for bench_*.py or benchmark*.py files before falling back to the language-level runner. Exit codes match the benchmark runner’s, making it scriptable for regression detection in CI.

Usage

raiku bench PACKAGE [--version VER] [--runner CMD] [--count N]

Arguments

ArgumentDescription
PACKAGEName of the installed package to benchmark

Flags

FlagShortDefaultDescription
--versionlatest installedBenchmark a specific installed version
--runnerauto-detectedOverride the benchmark runner (space-separated command string)
--count-nrunner defaultIteration count — passed to the runner where supported (currently Python)

Auto-Detection by Language

LanguageRunnerCommand
Pythonpytest-benchmark (file discovery first)python -m pytest --benchmark-only -v
Python (fallback)timeitpython -m timeit -n 1000 pass
Rustcargo bench (criterion)cargo bench
Cmake benchmake bench
C++cmake benchcmake --build build --target bench
C++ (fallback)make benchmake bench
Zigzig build benchzig build bench
Javamvn benchmarkmvn exec:java -Dbenchmark=true -q
C#dotnet benchdotnet run -c Release
Gogo test -benchgo test -bench=. -benchmem -run=^$ ./...
For Python, raiku bench first scans src/ for files matching bench_*.py or benchmark*.py. If found, the first matching file is executed directly with python <file> before any other runner is tried.
For Rust packages, cargo bench requires that the Cargo.toml defines at least one [[bench]] section. Packages that do not ship benchmarks will exit with an error from Cargo, not from Raiku.

Behavior

  • Benchmarks run inside the package’s cache directory (~/.raiku/cache/<Language>/<name>/<version>/).
  • The selected runner name and full command are printed before execution.
  • The exit code of raiku bench matches the benchmark runner’s exit code.
  • If no runner binary is found for the language, raiku bench prints an actionable message and exits cleanly.
  • The --count flag is currently forwarded only for Python runners.
Benchmarks can be CPU- and memory-intensive. Avoid running raiku bench on shared or low-resource machines during peak usage. Use --runner to pass flags like -bench=BenchmarkFoo to limit scope.

Examples

raiku bench blazing-vec

Sample Output

Benchmarking blazing-vec v2.1.0 [Rust] in ~/.raiku/cache/Rust/blazing-vec/2.1.0

  Runner:  cargo bench
  Command: cargo bench

   Compiling blazing-vec v2.1.0
    Finished bench [optimized] target(s) in 4.32s
     Running benches/criterion_bench.rs

dot_product/64          time: [12.345 ns 12.401 ns 12.468 ns]
dot_product/256         time: [48.123 ns 48.256 ns 48.401 ns]
matrix_multiply/64x64   time: [1.2345 µs 1.2401 µs 1.2468 µs]

✓ Benchmarks completed for 'blazing-vec'.
For reproducible benchmark comparisons, pin the package at a specific version with raiku pin add PACKAGE VERSION before benchmarking, then use --version to compare results between two pinned versions side by side.

Build docs developers (and LLMs) love