Skip to content

Interleave baseline and new benchmark rounds - #173

Merged
Jake Bailey (jakebailey) merged 3 commits into
mainfrom
interleave-benchmarks
Oct 28, 2026
Merged

Jake Bailey (jakebailey) merged 3 commits into
mainfrom
interleave-benchmarks

Conversation

@jakebailey

Copy link
Copy Markdown
Member

Comparisons used to measure every new-compiler iteration and then every baseline iteration. On shared Azure VMs the VM's speed can change between those two phases, which shifts every sample on one side and produces false regressions/improvements (up to 7% in A/A runs).

This alternates the two sides in 4 pairs of shorter rounds (new/baseline, then baseline/new, ...) so drift hits both sides about equally, then merges the rounds back into one benchmark file per side.

  • Each round runs the configured warmups; the total measured iteration count is unchanged. ts-perf merge gains --iterations to record the total, since merging files with different counts otherwise drops it.
  • Scenarios cloned at the compiler commit (the strada scenarios when comparing JS compilers) are set up again when switching sides. clone_strada_scenario marks this with TSPERF_SCENARIO_COMMIT_DEPENDENT_FILE.
  • On hosted runners, each round waits for the machine to be quiet, retrying up to 3 times, since 8 checks per job make an occasional 60s timeout likely.
  • INTERLEAVE_BENCHMARKS (default on) can turn this off to get the old sequential steps.

Validation on the Azure Linux pool (preset faster), 13 scenarios per run:

A/A runs, abs. baseline/new shift Interleaved (6 runs) Sequential (5 runs)
Median 0.42% 0.58%
90th percentile 1.14% 1.53%
Max 2.52% 7.30%
Over 1% 13% 32%

On a real two-commit comparison, the sequential run reported a false +6.1% on vscode; the interleaved run kept every scenario within ±1.8%. Measurement takes about twice as long (warmups per round), but whole jobs take only about 5–10% longer.

Sequential baseline and new phases on shared cloud VMs can shift every
sample when VM speed changes between phases. Alternate shorter rounds in
new/baseline, baseline/new order and merge them per side, so drift widens
error bars instead of producing a false difference.

Add ts-perf merge --iterations to record the per-side total, and mark
scenarios cloned at the compiler commit so they are set up again when
switching sides.
Interleaved jobs check for quiet eight times instead of twice, so rare
timeouts from brief periodic I/O on otherwise idle VMs fail runs far more
often. Retry each check up to three times before failing.
@jakebailey
Jake Bailey (jakebailey) merged commit 628146b into main Oct 28, 2026
47 checks passed
@jakebailey
Jake Bailey (jakebailey) deleted the interleave-benchmarks branch October 28, 2026 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant