Skip to content

Commit d2308c4

Browse files
Merge pull request #186 from NullVoxPopuli-ai-agent/fix-benchmark-indicators
Improve benchmark output indicators
2 parents 5b25517 + b23d54f commit d2308c4

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

scripts/format-bench-cli.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,12 @@ function formatTime(ns) {
3434
function deltaEmoji(pct) {
3535
const abs = Math.abs(pct);
3636

37-
if (abs < 1) return '⚪';
37+
if (abs < 2) return '⚪';
3838
if (pct <= -5) return '🟢';
3939
if (pct >= 5) return '🔴';
40+
if (pct < 0) return '🟢';
4041

41-
return '🟡';
42+
return '🟠';
4243
}
4344

4445
// Group control/experiment pairs
@@ -122,5 +123,5 @@ for (const row of rows) {
122123
}
123124

124125
console.log();
125-
console.log('🟢 faster · 🔴 slower · 🟡 within 5% · ⚪ within 1%');
126+
console.log('🟢 faster · 🔴 slower · 🟠 slightly slower · ⚪ within 2%');
126127
console.log();

scripts/format-bench-comment.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,11 @@ function formatTime(ns) {
5959
function deltaEmoji(pct) {
6060
const abs = Math.abs(pct);
6161
// negative pct means experiment is faster (lower time = better)
62-
if (abs < 1) return '⚪';
62+
if (abs < 2) return '⚪';
6363
if (pct <= -5) return '🟢';
6464
if (pct >= 5) return '🔴';
65-
return '🟡';
65+
if (pct < 0) return '🟢';
66+
return '🟠';
6667
}
6768

6869
function buildSummary(json) {
@@ -105,7 +106,7 @@ function buildSummary(json) {
105106
'|---|---|---:|---:|---:|',
106107
...rows,
107108
'',
108-
'> 🟢 faster · 🔴 slower · 🟡 within 5% · ⚪ within 1%',
109+
'> 🟢 faster · 🔴 slower · 🟠 slightly slower · ⚪ within 2%',
109110
'',
110111
].join('\n');
111112
}

0 commit comments

Comments
 (0)