Skip to content

Bench: interleaved A/B measurement (CPython vs @compiled) - #92

Merged
b-re-w merged 2 commits into
developfrom
work/bench-interleaved
Oct 3, 2026
Merged

b-re-w merged 2 commits into
developfrom
work/bench-interleaved

Conversation

@b-re-w

@b-re-w b-re-w commented Oct 3, 2026

Copy link
Copy Markdown
Member

Refs #41

Feature added

run.py interleaved [--pairs N] [--write] is a new measurement mode. For each benchmark it alternates CPython and the compiled extension A/B, flipping the order every pair, and reports:

  • the median per-pair speedup (CPython time / compiled time) and its range;
  • the 1-minute load average recorded at every pair;
  • a JSON file with --write.

Any pair whose outputs differ fails the run.

Why

The machine is never quiet during the day (load 5–33). The leader decided (2026-10-03) to use this interleaved A/B method as the official M2 measurement if no quiet window appears, reporting ratios rather than absolute times.

Verified

Smoke run at tiny sizes: all modes run and outputs agree in every pair. At those sizes process startup dominates, so the ratios mean nothing yet.

b-re-w added 2 commits October 3, 2026 18:46
run.py interleaved alternates CPython and the compiled extension pair by
pair (order flipped each pair) in one time window and reports the median
per-pair speedup with its range and the load at every pair. Load hits both
sides alike, so the ratio is usable when the machine is never quiet (leader
decision 2026-10-03: the official method if no quiet window appears).

Refs #41
11 A/B pairs per benchmark at full size, order alternated, under 1-min load
12-36 (the machine had no quiet window all day). Median CPython/compiled
speedup: nbody 28.5x (13.6-46.5), spectral-norm 17.9x (1.2-34.0),
fannkuch-redux 29.2x (11.1-38.2), wordfreq 1.1x (0.9-1.6); binary-trees not
compiled (M2b). Outputs identical in every pair.

Refs #41
@b-re-w
b-re-w merged commit d29f678 into develop Oct 3, 2026
5 checks passed
@b-re-w
b-re-w deleted the work/bench-interleaved branch October 3, 2026 10:13
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