Lightweight benchmark orchestration for Mojo projects with practical suite structure, richer statistics, and CI-friendly reporting.
BenchSuite complements Mojo stdlib benchmark by focusing on suite-level workflow:
bench_*.mojofile discovery- multi-benchmark suite execution
- environment-aware report output
- baseline save/compare flow for regression tracking
- Adaptive benchmarking with calibration and batched sampling (
auto_benchmark) - Percentile statistics: p50, p95, p99 (plus mean/min/max)
- Total runtime and loops-per-sample accounting
- Console, Markdown, and CSV report exports
- Timestamped report persistence under
benchmarks/reports/
- Benchmark discovery via
scripts/run_benchmarks.py - Filters:
--only <glob>--skip <glob>
- Baseline operations:
--save-baseline <name>--compare-baseline <name>--regression-threshold-percent <float>--fail-on-regression
- Machine-readable output:
--summary-json <path>
- GitHub Actions benchmark workflow:
.github/workflows/benchmarks.yml- summary + report artefact upload
- report mode or enforce mode for regression gating
benchmarks/bench_adaptive.mojobenchmarks/bench_comprehensive.mojobenchmarks/bench_string_utils.mojobenchmarks/bench_config_workloads.mojobenchmarks/bench_data_transform.mojobenchmarks/bench_startup_costs.mojo
pixi install
pixi run bench-allRun examples:
pixi run run-example
pixi run run-example-complex
pixi run run-example-startup
pixi run run-example-gpuRun a single benchmark suite:
pixi run bench-startupRun with summary output:
pixi run bench-summarySave baseline snapshot:
pixi run bench-save-baselineCompare against baseline:
pixi run bench-compare-baselineDirect runner usage:
python3 scripts/run_benchmarks.py --only "bench_startup_*" --summary-json benchmarks/reports/summary.json
python3 scripts/run_benchmarks.py --compare-baseline main --regression-threshold-percent 5.0run-examplerun-example-complexrun-example-startuprun-example-gpubench-adaptivebench-comprehensivebench-stringsbench-configbench-data-transformbench-startupbench-allbench-summarybench-save-baselinebench-compare-baselineclean-reportsclean-mdclean-csvlist-reports
docs/QUICKSTART.mddocs/RELEASE_NOTES.mddocs/EXAMPLES.mddocs/ROADMAP.md
benchmarks/reports/<suite>_<timestamp>.mdbenchmarks/reports/<suite>_<timestamp>.csv
- configured by
--summary-json - includes suite failures, parsed result rows, and optional baseline comparison
- stored at
benchmarks/baselines/<name>.json - created via
--save-baseline
BenchSuite mirrors TestSuite’s pragmatic discovery model:
- discover files by naming pattern (
bench_*.mojo) - keep benchmark registration explicit inside each suite’s
main() - avoid overpromising runtime reflection-based auto-registration
This keeps behaviour explicit, stable, and easy to reason about in CI.
- Mojo via pixi
- Python 3 for runner orchestration
- compatible GPU development environment for
run-example-gpu
Apache 2.0