From b23d54f1bdcbb23454ec55554b496589462c6ac0 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Thu, 19 Mar 2026 22:44:50 -0400 Subject: [PATCH] Improve benchmark output indicators --- scripts/format-bench-cli.mjs | 7 ++++--- scripts/format-bench-comment.mjs | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/scripts/format-bench-cli.mjs b/scripts/format-bench-cli.mjs index 54b6c2e..516d5c3 100644 --- a/scripts/format-bench-cli.mjs +++ b/scripts/format-bench-cli.mjs @@ -34,11 +34,12 @@ function formatTime(ns) { function deltaEmoji(pct) { const abs = Math.abs(pct); - if (abs < 1) return '⚪'; + if (abs < 2) return '⚪'; if (pct <= -5) return '🟢'; if (pct >= 5) return '🔴'; + if (pct < 0) return '🟢'; - return '🟡'; + return '🟠'; } // Group control/experiment pairs @@ -122,5 +123,5 @@ for (const row of rows) { } console.log(); -console.log('🟢 faster · 🔴 slower · 🟡 within 5% · ⚪ within 1%'); +console.log('🟢 faster · 🔴 slower · 🟠 slightly slower · ⚪ within 2%'); console.log(); diff --git a/scripts/format-bench-comment.mjs b/scripts/format-bench-comment.mjs index cf5f490..2be4eb0 100644 --- a/scripts/format-bench-comment.mjs +++ b/scripts/format-bench-comment.mjs @@ -59,10 +59,11 @@ function formatTime(ns) { function deltaEmoji(pct) { const abs = Math.abs(pct); // negative pct means experiment is faster (lower time = better) - if (abs < 1) return '⚪'; + if (abs < 2) return '⚪'; if (pct <= -5) return '🟢'; if (pct >= 5) return '🔴'; - return '🟡'; + if (pct < 0) return '🟢'; + return '🟠'; } function buildSummary(json) { @@ -105,7 +106,7 @@ function buildSummary(json) { '|---|---|---:|---:|---:|', ...rows, '', - '> 🟢 faster · 🔴 slower · 🟡 within 5% · ⚪ within 1%', + '> 🟢 faster · 🔴 slower · 🟠 slightly slower · ⚪ within 2%', '', ].join('\n'); }