Skip to content

ci: automated performance regression detection #69

@membphis

Description

@membphis

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:

  1. Checkout base branch → build → record ops/s for small and medium scenarios.
  2. Checkout PR branch → build → record ops/s for same scenarios.
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions