← Back to the article

Evidence: Vite React dev-server benchmark

Every number in 4 Things Making Your Vite Dev Server Slow comes from these files. Measured on an Apple M5 (10 cores), Node v24.16.0, Vite 7.

Results

FileWhat's in it
bench-results.jsonThe five-configuration matrix: cold start (5 runs), first-load module-graph crawl, HMR round-trip, production build (3 runs), and dist chunk tables. Records machine specs and dependency versions.
sweep-results.jsonModule-count sweep from 68 to 3,059 modules against both React plugins, 3 runs per cell, plus the fitted per-module cost and the real @mui/icons-material comparison.
mui-warm.jsonCold vs warm dependency-cache runs for the MUI icon barrel — the test that shows most of its cold cost is esbuild pre-bundling.

Unedited run logs

FileProduced by
bench.txtnode bench.mjs
sweep.txtnode sweep.mjs
mui-warm.txtnode mui-warm.mjs

Scripts

FileWhat it does
gen.mjsGenerates the fixture: N components behind a barrel index.js, 50 SVG icons, three app variants. Size set by FIXTURE_COMPONENTS (default 3000).
bench.mjsThe five-configuration matrix. Starts a real dev server per run, crawls the entry module graph the way a browser does, drives HMR over Vite's websocket.
sweep.mjsThe module-count sweep, the linear fit, and the third-party package comparison.
mui-warm.mjsCold/warm dependency-cache test for the pre-bundling hypothesis.
charts.mjsRenders the article's SVG charts directly from the results JSON — no numbers are typed by hand.

Reproducing it

The fixture source is generated, so it isn't committed. From evidence/articles/vite-react-performance/fixtures/ in the PageSpeedFix repo:

node gen.mjs
npm install
node bench.mjs
node sweep.mjs
node mui-warm.mjs

Absolute timings depend on your machine. The ratios, the linear fit, and the module counts should reproduce.

Charts

first-load-transform.svg · build-time.svg · module-count-sweep.svg