mirror of
https://github.com/pnpm/pnpm.git
synced 2026-07-19 12:12:34 -04:00
Report each scenario's minimum latency to Bencher instead of the mean, so the threshold tracks the min. On shared CI runners the timed work is CPU/disk-bound (the simulated latency only adds a deterministic floor, and the noisiest scenario runs --offline with no network), so the mean drifts run-to-run with host contention — byte-identical binaries differed ~30% on the offline scenario and tripped a spurious alert. Contention only ever adds time, so the minimum is the run least perturbed by a noisy neighbour and the truest regression signal. Emit Bencher Metric Format and upload the integrated benchmark with --adapter json, reporting the min honestly as the value (nanoseconds, min seconds x 1e9, to match the latency measure's unit) rather than relabelling hyperfine's mean field. The TS test-duration and micro-benchmark uploads keep shell_hyperfine (single-sample, so min equals mean there). Because the min only needs one uncontended run, hyperfine's default sampling suffices. The human comment still shows mean +/- σ. Note: the workflow_run-triggered comment workflow runs from the default branch, so this PR's own benchmark-comment upload fails (main still uses --adapter shell_hyperfine); it self-heals once this lands on main.