From: Jérôme Benoit Date: Tue, 10 Feb 2026 21:38:44 +0000 (+0100) Subject: fix(bench): disable warmup for slow busy-wait benchmarks X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=24f711afea6f03563889130f43e6818e80767f02;p=benchmarks-js.git fix(bench): disable warmup for slow busy-wait benchmarks Tinybench's default warmup phase caused timeouts with 2-second busy-wait functions. Disable warmup and set minimum iterations for proper measurement. --- diff --git a/busy-wait.mjs b/busy-wait.mjs index dbf6c59..20ec30a 100644 --- a/busy-wait.mjs +++ b/busy-wait.mjs @@ -67,7 +67,12 @@ async function sleepTimeoutBusyWait (timeoutMs, intervalMs = interval) { } while (performance.now() < timeoutTimestampMs) } -const bench = new Bench({ name: 'Busy wait', time: timeout + interval }) +const bench = new Bench({ + iterations: 2, + name: 'Busy wait', + time: 5000, + warmup: false, +}) bench.add('dummyTimeoutBusyWait', () => { dummyTimeoutBusyWait(timeout)