MCPcopy Create free account
hub / github.com/modem-dev/hunk / isMaterialRegression

Function isMaterialRegression

scripts/compare-release-benchmarks.ts:143–162  ·  view source on GitHub ↗
(
  baseMedian: number,
  headMedian: number,
  threshold: BenchmarkThreshold,
)

Source from the content-addressed store, hash-verified

141
142/** Determine whether a comparable metric exceeded its material-regression threshold. */
143export function isMaterialRegression(
144 baseMedian: number,
145 headMedian: number,
146 threshold: BenchmarkThreshold,
147) {
148 const absoluteDelta = headMedian - baseMedian;
149 if (absoluteDelta <= 0) {
150 return false;
151 }
152
153 if (absoluteDelta < threshold.minAbsoluteRegression) {
154 return false;
155 }
156
157 if (baseMedian === 0) {
158 return headMedian > 0;
159 }
160
161 return headMedian / baseMedian >= threshold.maxRegressionRatio;
162}
163
164function relativeDelta(baseMedian: number, headMedian: number) {
165 if (baseMedian === 0) {

Callers 2

compareBenchmarkRunsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected