Skip to content

Align bench delta formatting with ember-eslint-parser - #71

Merged
NullVoxPopuli merged 1 commit into
NullVoxPopuli:mainfrom
NullVoxPopuli-ai-agent:port-bench-delta-formatting
Jul 3, 2026
Merged

Align bench delta formatting with ember-eslint-parser#71
NullVoxPopuli merged 1 commit into
NullVoxPopuli:mainfrom
NullVoxPopuli-ai-agent:port-bench-delta-formatting

Conversation

@NullVoxPopuli-ai-agent

Copy link
Copy Markdown

Ports ember-eslint-parser's benchmark delta calculation/formatting, so both repos' bench tooling reads the same way.

What changed

  • Delta classification (the faster/slower logic):
    • ⚪ within ±2% — noise floor
    • 🟢 faster by more than 2% (previously a 2–5% win rendered as 🟡 "within 5%")
    • 🟠 slower by 2–5% — "slightly slower"
    • 🔴 slower by 5%+
  • Shared scripts/bench-utils.mjs: formatTime, deltaEmoji, parsePairs, readBenchJSON, and the legend now live in one module used by both format-bench-cli.mjs and format-bench-comment.mjs (previously duplicated, and their thresholds had already drifted: the CLI/comment used a 1% white band while ember-eslint-parser uses 2%).

Example output

   Benchmark    Control (p50)   Experiment (p50)       Δ
   ──────────   ─────────────   ────────────────   ─────
⚪ gts small        100.00 µs           99.00 µs   -1.0%
🟢 gts large          2.00 ms            1.93 ms   -3.5%
🟠 gjs medium       500.00 µs          515.00 µs   +3.0%
🔴 hbs big          800.00 µs          860.00 µs   +7.5%

🟢 faster · 🔴 slower · 🟠 slightly slower · ⚪ within 2%

Verified with a synthetic results file covering all four bands (CLI table + PR comment markdown); pnpm lint clean.

🤖 Generated with Claude Code

Ports ember-eslint-parser's delta classification: a 2% noise floor,
green for any improvement beyond noise, a distinct "slightly slower"
band at 2-5%, and red at 5%+. The old symmetric "within 5%" yellow hid
real 2-5% wins and regressions behind the same neutral marker.

Also extracts the shared helpers (formatTime, deltaEmoji, parsePairs,
readBenchJSON) into scripts/bench-utils.mjs, mirroring ember-eslint-
parser's layout, so the CLI and PR-comment formatters can't drift apart.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@NullVoxPopuli
NullVoxPopuli merged commit bfc7c17 into NullVoxPopuli:main Jul 3, 2026
6 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants