Skip to content

Performance ​

Method ​

pnpm bench [ids...] [--rows N] bundles each case as a minified production build, serves it locally and drives headless Chrome over the DevTools protocol (--headless=new --js-flags=--expose-gc --enable-precise-memory-info). The page is cross-origin isolated, so performance.now() has 5 µs precision.

Each row is <div class="row"><span class="id">…</span><span class="label">…</span></div>. Scenarios:

ScenarioWork
initcreate all rows
init+layoutcreate all rows and force layout
redrawOnechange one label
redrawAllchange every label
redrawAll+layoutchange every label and force layout
toggleOnetoggle the class of one row
toggleAlltoggle the class of every row

Every sample runs on a fresh mount after gc(). The reported number is the median of 21 runs after 4 warmups. The clock includes the library's commit: a microtask flush for SurgiJS, nextTick for Vue, flushSync for React and Svelte, Updates.process() for FAST. Memory reports the retained heap after gc() (median of 9) and the heap allocated by one full redraw. Before timing, the harness checks the rendered DOM after every operation.

Cases: native DOM, SurgiJS (signals per row), Solid, Inferno, lit-html, FAST Element (light DOM, repeat, observable row fields), Svelte 5, Vue 3, React 19. Results land in bench/results.json (1000 rows) and bench/results-N.json. A run with a subset of ids writes only those libraries to the results file.

Results ​

Chrome 157, headless, Linux VM.

Change every label, ms:

Library1 00010 000
Native0.343.48
SurgiJS 0.3.00.444.25
lit-html 3.30.534.90
FAST Element 3.10.586.83
Inferno 100.757.76
Solid 1.90.777.45
React 191.2311.19
Svelte 51.368.83
Vue 31.7118.52

10 000 rows:

Libraryinit, mstoggle all, msheap, MBcase bundle, KB gzip
Native12.12.90.90.4
SurgiJS 0.3.014.92.71.93.1
Solid15.34.66.85.4
Inferno16.75.23.99.4
Vue21.114.92.322.5
Svelte26.67.410.719.3
lit-html33.43.34.64.1
FAST Element42.64.80.518.5
React205.69.16.967.4

Framework idioms ​

Each case uses the keyed-list pattern that the framework documents for this job, the same one the js-framework-benchmark implementations use:

  • Svelte: the list and each row's fields are $state.raw. Deep $state proxies every row on first access and made init 13 times slower (328 ms at 10 000 rows before the change).
  • Vue: one component renders the list with v-for, v-memo and shallowRef. A component per row is faster for a single label change (0.07 ms against 4.0 ms here), but redrawAll is about twice as slow (35.9 ms against 18.5 ms at 10 000 rows), so the single-component form is what the bench reports.

Bundle size ​

Bundlemin + gzip
full runtime (export *)5.9 KB
useState only0.5 KB
counter app (compiled)3.6 KB
dropdown app (compiled)5.3 KB

pnpm size checks these on every pull request.

MIT License