From a97def782f908d6ccfc36fdf8923cd841386f447 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Fri, 28 Aug 2026 22:50:27 +0000 Subject: [PATCH] doc: clarify node:bench significance policy Signed-off-by: James M Snell Assisted-by: Opencode PR-URL: https://github.com/nodejs/node/pull/65631 Reviewed-By: Filip Skokan --- doc/api/bench.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/doc/api/bench.md b/doc/api/bench.md index 16833caac54..300ae3aab0e 100644 --- a/doc/api/bench.md +++ b/doc/api/bench.md @@ -128,6 +128,24 @@ calculate pooled throughput from the raw `samples`; operation counts should be summed as `bigint` values because their total can exceed `Number.MAX_SAFE_INTEGER` even though each count cannot. +### Comparing benchmark results + +`node:bench` does not designate a benchmark as a baseline or produce a pass/fail +comparison between runs. It exposes raw samples, stable benchmark identities, +parameters, and tags so that comparison policy can remain in higher-level +tools. A tool can use `benchId` to match the same declaration and parameters +across compatible source layouts, and use a tag or its own metadata to identify +a baseline. + +Comparison tools should retain the raw sample rates and verify that execution +plans and relevant environment details are comparable. The appropriate analysis +depends on the experimental design and distribution. For example, independent +samples might use Welch's t-test or a rank-based test, while observations that +were deliberately paired require paired analysis. Tools should also consider +effect sizes, uncertainty, and correction when testing multiple benchmarks. +The general-purpose {Histogram} statistics in `node:perf_hooks` can support such +analysis, but the runner does not select a method or significance threshold. + ## Reusable runners The module-level declaration functions use a shared runner and schedule it