Benchmark warm memory, and add A/B tools for comparing checkouts #5

Closed natemoo.re
targeting one-chunk-transform from bench-tools
Closed opened by and assigned to natemoo.re
targeting one-chunk-transform from bench-tools

Adds warm memory to the benchmarks, and three A/B tools for comparing checkouts.

Warm RSS #

throughput.mjs reported peak RSS growth over the first pass only. That pass pays one-time costs that differ by kind of tool: a wasm engine compiles and tiers up inside it, while a native addon is loaded before the measurement starts. It now also reports warm growth, the median of three passes after the timed ones. The median matters because V8 grows its heap every few passes on its own schedule, and a single pass can land on that step for one build and not another. On TSX to the automatic runtime, typestrip grows +0.8 MiB warm, against oxc-transform's +1.9.

The published tables still show the first pass only.

Tools #

  • bench/compare.mjs times checkouts of typestrip, and oxc-transform, on the published inputs plus the small corpus and an enum/namespace-dense set. Each round runs every target in turn, alternating the order, so machine load lands on all of them alike. It reports MB/s, load and first-call time, and first-pass and warm RSS.
  • bench/usage-bytes.mjs reports the bytes each usage profile downloads, by recording which .wasm files a fresh process reads, and the npm package's size.
  • scripts/compare-outputs.mjs checks that two checkouts write the same output and report the same errors for every input, mode and JSX runtime, whole and chunked.

The engines PR stacked on this one uses all three for its evidence.

No changeset: nothing here ships in the package.

Stacked on #4.

Commits 0