Skip to main content
Module

x/pretty_benching/mod.ts>calculateThresholds

:sauropod: A small lib to make your Deno benchmarking progress and results look pretty
Latest
function calculateThresholds
import { calculateThresholds } from "https://deno.land/x/pretty_benching@v0.3.3/mod.ts";

Calculates Thresholds from the historic data for each benchmark.

EXPERIMENTAL The default way of calculating may change, if you relay on thresholds provide your calculation so it wont change unexpectedly

The default way the thresholds are calculated:

  • only calculate threshold for benchmark, which has at least 5 previous runs
  • green is the (minimum of the measured measuredRunsAvgMs) * 1.1
  • yellow is the (maximum of the measured measuredRunsAvgMs) * 1.2

This can be overridden with the options.

Parameters

optional
options: { minProceedingRuns?: number; calculate?: (runs: BenchmarkHistoryItem<T, K>[]) => Threshold; }