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'); }