Skip to content

feat: performance regression gate on release tags (benchmark CI proposal, draft) - #1182

Draft
GOODBOY008 wants to merge 2 commits into
apache:mainfrom
GOODBOY008:feat/benchmark-regression-gate
Draft

GOODBOY008 wants to merge 2 commits into
apache:mainfrom
GOODBOY008:feat/benchmark-regression-gate

Conversation

@GOODBOY008

Copy link
Copy Markdown
Member

Status: DRAFT — proposal for discussion. Split out of #575 per review feedback; the pure-JMH benchmark module itself is in #575. This PR exists so the CI-gate idea can be reviewed (and voted on) on its own merits.

What this proposes

Wire the FesodBenchmark suite (from #575) into a performance regression gate that runs on release tags and manual dispatch only — never per pull request.

Why a gate at all

  • Fesod's positioning is high performance / low memory, but today nothing catches a performance regression before a release ships it.
  • Manual benchmark runs answer "is it fast", but nobody re-runs them systematically at release time.

Design highlights

Aspect Choice
Triggers release tags + workflow_dispatch (never per-PR — shared-runner time noise is ±15–20%)
Trusted signal gc.alloc.rate.norm (allocation per op) — measured noise ±0.1%, effectively deterministic → regression beyond threshold fails
Noisy signal average time — fails only beyond threshold and with non-overlapping JMH error bars; overlapping intervals → WARN only (avoids a flaky gate)
Baseline committed JSON, only ever generated on ubuntu-24.04 + JDK 17 (Temurin) runners; first run bootstraps it via an automated PR; passing tags advance it via automated PRs
Notification regression on a tag → report comment on the tag's GitHub Release (fallback: issue, fallback: job warning) — best-effort ladder
ASF compliance actions/* only; bot pushes only to benchmark/baseline-* branches; baseline JSON enters the repo only through reviewed PRs

Thresholds default to warn 10% / fail 20%, overridable per dispatch or via repo variables (BENCHMARK_WARN_PCT / BENCHMARK_FAIL_PCT).

What's in the diff

  • baseline/BaselineRunner — pinned-contract JMH runner (3 forks, 3×1s warmup, 5×2s measurement, -Xms1g -Xmx1g -XX:+UseG1GC, gc profiler always on)
  • baseline/BaselineComparator — tiered comparator, Markdown report, GitHub Actions annotations
  • .github/workflows/benchmark.yml — run / compare / notify-regression / update-baseline jobs
  • baseline/README.md + a gate section in benchmark.md

No baseline is committed up front: the first run on an apache runner bootstraps it through an automated PR, so the committed baseline has apache-runner provenance.

Context

@delei's review on #575 asked to keep the benchmark module to the JMH classes and not run benchmarks through CI currently — #575 now does exactly that. This draft carries the gate half so the idea is reviewable separately: happy to close it if the community isn't ready for it yet, or to adjust the design per feedback (e.g. different triggers, thresholds, or notification behavior).

@GOODBOY008
GOODBOY008 force-pushed the feat/benchmark-regression-gate branch 7 times, most recently from 0636776 to 575fc9c Compare October 10, 2026 10:08
Adds a fesod-benchmark module with JMH benchmarks for Fesod, kept to
pure JMH classes per review feedback: no CI integration, no report or
analysis code. Closes apache#572.

Suites (org.apache.fesod.sheet.benchmark):
- FesodBenchmark: read/write x XLSX/CSV x 1K/10K/100K rows (average
  time, 3 forks, fixed 1g G1 heap, stable execution contract)
- FesodVsPoiBenchmark: Fesod vs Apache POI on identical data (write,
  DOM read, batched streaming read; XLSX + XLS)
- deterministic data generation (fixed seed + fixed date anchor) and
  unit tests for the generator and file utilities

Benchmarks run manually via the shaded benchmarks.jar; see
fesod-benchmark/benchmark.md.
Wire FesodBenchmark into a performance regression gate (split out of

- BaselineRunner pins the execution contract (3 forks, 3x1s warmup,
  5x2s measurement, fixed JVM args, gc profiler) and writes JMH JSON
- BaselineComparator compares against the committed baseline with
  tiered, noise-aware verdicts (alloc/op hard-fail; time regressions
  gated on JMH error-bar overlap) and renders the Markdown report
- benchmark.yml runs the gate on release tags and manual dispatch only,
  bootstraps the baseline on first run via an automated PR, and posts
  regression reports on the matching GitHub Release (best-effort
  notification ladder)

No baseline is committed up front - the first run on an apache runner
bootstraps it through an automated PR, so the committed baseline has
apache-runner provenance.
@GOODBOY008
GOODBOY008 force-pushed the feat/benchmark-regression-gate branch from 575fc9c to 5917023 Compare October 12, 2026 01:22

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant