benchmark_stats.ts view source
(a: BenchmarkStatsComparable, b: BenchmarkStatsComparable, options?: BenchmarkCompareOptions | undefined): BenchmarkComparison Compare two benchmark results for practical and statistical significance. Uses percentage difference for effect magnitude classification, with Welch's t-test for statistical confidence. Cohen's d is computed as an informational metric but does not drive classification — its thresholds (0.2/0.5/0.8) are calibrated for social science and produce false positives in benchmarking where within-run variance is tight.
a
first benchmark stats (or any object with required properties)
b
second benchmark stats (or any object with required properties)
options?
comparison options
BenchmarkCompareOptions | undefinedreturns
BenchmarkComparison comparison result with significance, effect size, and recommendation
examples
const comparison = benchmark_stats_compare(result_a.stats, result_b.stats);
if (comparison.significant) {
console.log(`${comparison.faster} is ${comparison.speedup_ratio.toFixed(2)}x faster`);
}