Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions .github/workflows/ci-performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ jobs:
console.log('| Benchmark | Baseline | PR | Change | Status |');
console.log('|-----------|----------|----|---------| ------ |');

// Ignore relative changes below this absolute delta (milliseconds).
const ABSOLUTE_NOISE_FLOOR_MS = 2;

let hasRegression = false;
let hasImprovement = false;

Expand All @@ -214,14 +217,21 @@ jobs:
const change = ((prValue - baseValue) / baseValue * 100);
const changeStr = change > 0 ? \`+\${change.toFixed(1)}%\` : \`\${change.toFixed(1)}%\`;

// Benchmarks measured in fractions of a millisecond move by tens of
// percent on ordinary runner noise, so a relative threshold alone
// fails unrelated pull requests. Require the absolute change to
// clear a floor before the percentage decides the status.
const absoluteChange = prValue - baseValue;
const clearsNoiseFloor = Math.abs(absoluteChange) >= ABSOLUTE_NOISE_FLOOR_MS;

let status = '✅';
if (change > 50) {
if (change > 50 && clearsNoiseFloor) {
status = '❌ Much Slower';
hasRegression = true;
} else if (change > 25) {
} else if (change > 25 && clearsNoiseFloor) {
status = '⚠️ Slower';
hasRegression = true;
} else if (change < -25) {
} else if (change < -25 && clearsNoiseFloor) {
status = '🚀 Faster';
hasImprovement = true;
}
Expand Down