Motivation
The benchmark suite (benches/lua_bench.lua) is run manually via make bench and results are committed to docs/benchmarks.md. There is no automated gate that catches performance regressions on PRs.
This means a change that halves parse throughput (e.g. disabling AVX2 dispatch, breaking the skip-cache hot path) would merge silently.
Proposed approach
Add a CI job that runs a short, deterministic benchmark on every PR and posts a comparison comment:
- Checkout base branch → build → record ops/s for
small and medium scenarios.
- Checkout PR branch → build → record ops/s for same scenarios.
- If PR ops/s < base × 0.95 (5% regression threshold), fail the job and post a comment with the delta table.
Implementation options
criterion Rust benchmarks — deterministic, CI-friendly, produces JSON output. Requires porting the Lua bench logic to Rust (measures Rust-side throughput, not LuaJIT JIT-compiled throughput).
bencher GitHub Action — wraps arbitrary benchmark output, stores historical data, posts PR comments. Can wrap the existing lua_bench.lua output.
- Simple shell diff — run
lua_bench.lua twice, compare with awk. Fragile on shared runners due to noisy neighbors.
Recommended: bencher GitHub Action pointing at the existing Lua bench, filtering for small and github-100k scenarios (fast, representative).
Affected files
.github/workflows/ci.yml — add bench job
benches/lua_bench.lua — ensure machine-parseable output (already has structured output lines)
Related
Motivation
The benchmark suite (
benches/lua_bench.lua) is run manually viamake benchand results are committed todocs/benchmarks.md. There is no automated gate that catches performance regressions on PRs.This means a change that halves parse throughput (e.g. disabling AVX2 dispatch, breaking the skip-cache hot path) would merge silently.
Proposed approach
Add a CI job that runs a short, deterministic benchmark on every PR and posts a comparison comment:
smallandmediumscenarios.Implementation options
criterionRust benchmarks — deterministic, CI-friendly, produces JSON output. Requires porting the Lua bench logic to Rust (measures Rust-side throughput, not LuaJIT JIT-compiled throughput).bencherGitHub Action — wraps arbitrary benchmark output, stores historical data, posts PR comments. Can wrap the existinglua_bench.luaoutput.lua_bench.luatwice, compare withawk. Fragile on shared runners due to noisy neighbors.Recommended:
bencherGitHub Action pointing at the existing Lua bench, filtering forsmallandgithub-100kscenarios (fast, representative).Affected files
.github/workflows/ci.yml— addbenchjobbenches/lua_bench.lua— ensure machine-parseable output (already has structured output lines)Related