Version: 0.9.1 (Mojo 1.0 beta migration stream)
BenchSuite provides practical benchmark suite orchestration for Mojo projects:
- suite discovery by file naming (
bench_*.mojo) - adaptive measurement with richer statistics
- report persistence and baseline comparison for CI
It complements stdlib benchmark by focusing on project-level workflow rather than single-function microbenchmark ergonomics alone.
- warmup phase
- calibration phase to determine
loops_per_sample - batched sampling phase until:
- minimum sample count is met
- minimum runtime target is met
- returns per-operation metrics and run totals
namemean_time_nsmin_time_nsmax_time_nsiterations(total loop executions across all samples)p50_time_nsp95_time_nsp99_time_nstotal_time_nsloops_per_sample
- console output
- Markdown export
- CSV export
- timestamped file save support
Exports preserve mean/min/max compatibility and add percentile + total-time fields.
scripts/run_benchmarks.py discovers and executes bench_*.mojo suites, parses new CSV artefacts, and emits optional summary JSON.
--only <glob>--skip <glob>--save-baseline <name>--compare-baseline <name>--regression-threshold-percent <float>--fail-on-regression--summary-json <path>
Stored in benchmarks/baselines/<name>.json with:
- generation timestamp
- benchmark row count
- per-benchmark keyed rows (
suite:benchmark) including core timing fields
- compares current rows to matching baseline IDs
- computes mean-time percent delta
- classifies:
- regression (
delta > threshold) - improvement (
delta < -threshold)
- regression (
--fail-on-regressionexits non-zero when regressions are present
Workflow: .github/workflows/benchmarks.yml
Capabilities:
- run benchmark suites on PR/push/manual dispatch
- optional baseline comparison
- report vs enforce regression modes
- upload artefacts (
.md,.csv,.json)
Current practical suites:
bench_adaptive.mojobench_comprehensive.mojobench_string_utils.mojobench_config_workloads.mojobench_data_transform.mojobench_startup_costs.mojo
- keep file discovery automated
- keep benchmark registration explicit in each suite
main() - avoid relying on unstable runtime reflection for function auto-enumeration