Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Sep 5, 2021
1 parent b4b90eb commit f2b2542
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/run/measure/min_loop_duration.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ const computeMinLoopDuration = function (measures) {
return Math.max(minMeasureCost, minResolution)
}

// We use a median instead of a mean because:
// - It is more precise by being more resistent against slow outliers
// - The "typical" `measureCost` per loop is more important than the worst
// case ones
const getMinMeasureCost = function (measures) {
return getSortedMedian(measures) * MEASURE_COST_RATIO
}
Expand Down

0 comments on commit f2b2542

Please sign in to comment.