From 101ffff8e2c7adf234b348dbbc2e6865dbeefce2 Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Fri, 26 Jun 2026 15:46:48 +0100 Subject: [PATCH] Only color benchmark change when delta exceeds 5% MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Treat changes within ±5% as noise and show a neutral white circle; only swings beyond 5% get a green/red indicator. The percent value is still always shown. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/benchmark-comment.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/benchmark-comment.js b/.github/workflows/benchmark-comment.js index 75f0658439..bdb0055c60 100644 --- a/.github/workflows/benchmark-comment.js +++ b/.github/workflows/benchmark-comment.js @@ -109,12 +109,14 @@ function changeCell(before, after, lowerIsBetter) { } const percent = Number((((after - before) / before) * 100).toFixed(1)); - if (percent === 0) { - return `:white_circle: ${code('0%')}`; + const label = code(`${percent > 0 ? '+' : ''}${trimNumber(percent)}%`); + + if (Math.abs(percent) <= 5) { + return `:white_circle: ${label}`; } const improved = lowerIsBetter ? percent < 0 : percent > 0; - return `${improved ? ':green_circle:' : ':red_circle:'} ${code(`${percent > 0 ? '+' : ''}${trimNumber(percent)}%`)}`; + return `${improved ? ':green_circle:' : ':red_circle:'} ${label}`; } function detailTable(rows) {