Skip to content
Source
Sign inSign up
TanStack/virtual

benchmarks

README.md

Virtualization benchmarks

Reproducible browser benchmarks comparing @tanstack/react-virtual, virtua, react-virtuoso, react-window v2, and react-aria-components Virtualizer.

Same data, same scenarios, same harness β€” driven by Playwright against a real browser running a real Vite-built React app for each library.

Library matrix

idWhat it measures
tanstackHeadless @tanstack/react-virtual + plain DOM rows
tanstack-racTanStack virtual + role="listbox" / role="option" (no RAC collection)
rac-listboxReact Aria ListBox only β€” collection overhead, all items in DOM
racReact Aria Virtualizer + ListBox β€” full integrated stack
virtua, virtuoso, windowExisting third-party baselines

rac-listbox skips mount-fixed-100k (100k DOM nodes is intentionally out of scope).

RAC accuracy scenarios: React Aria's virtualizer does not expose scrollToIndex. The harness uses layout-derived scrollTop + native scroll events. If the target row is not mounted after scroll settles, landingErrorPx is -1 (item missing from DOM). rac-listbox (non-virtualized) reports accurate landings because every row stays in the DOM.

Running

# from the repo root
pnpm install
pnpm --filter @tanstack/virtual-core build
cd benchmarks
pnpm exec playwright install chromium

# Full matrix, 5 runs per cell (~10 min)
pnpm bench

# Quick subset
pnpm bench -- --runs 2 --libs tanstack,virtua --scenarios mount-fixed-10k

# Watch the browser as it runs
pnpm bench:headed

Results land in benchmarks/results/<timestamp>.json (raw, every run) and benchmarks/results/LATEST.md (median table from the last run).

How it works

benchmarks/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main.tsx                Reads ?lib=... &scenario=...
β”‚   β”œβ”€β”€ pages/                  One file per library; all share the same harness
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ dataset.ts          Deterministic item generator (LCG-seeded)
β”‚   β”‚   └── harness.ts          Installs window.bench.run() that every page uses
β”‚   └── scenarios/types.ts      The fixed scenario list. Adding a row here
β”‚                               surfaces it in every library and the runner.
β”œβ”€β”€ runner/run.mjs              Playwright driver. Boots a server, runs each
β”‚                               (lib Γ— scenario Γ— run), aggregates medians.
β”œβ”€β”€ results/                    JSON snapshots + LATEST.md
└── package.json

Every library page mounts an identical dataset, registers a HarnessHandle, and exposes the same window.bench.run(scenario) entrypoint that returns ScenarioMetrics. That means the runner doesn't know or care which library it's measuring β€” it just calls one global function per page.

Scenarios

iditemssizedynamicaction
mount-fixed-1k1,00030 pxnoidle (just mount)
mount-fixed-10k10,00030 pxnoidle
mount-fixed-100k100,00030 pxnoidle
mount-dynamic-1k1,000variesyeswait for total size to settle
mount-dynamic-10k10,000variesyeswait for total size to settle
scroll-to-bottom-10k10,00030 pxnorAF-driven scroll, 1.5 s
fast-scroll-dynamic-10k10,000variesyesrAF-driven scroll, 1.5 s
jump-to-end-dynamic-10k10,000variesyesscrollToIndex(9999) then wait until scrollTop stable for 5 frames

Metrics

fieldmeaning
mountMsReact.render(...) call β†’ useEffect runs (commit complete).
firstPaintMsReact.render(...) call β†’ one rAF after commit (β‰ˆ first paint).
actionMsAction-specific. For scroll actions, total elapsed during the scripted scroll. For dynamic-measure, time from mount to a stable getTotalSize() (8 consecutive frames unchanged). For jump-to-end, time from scrollToIndex to position stable for 5 frames.
scrollFpsAverage FPS sampled during the scripted scroll.
longFramesCount of frames with inter-frame gap > 32 ms.
jankMsSum of frame durations > 50 ms during the action.
memoryBytesperformance.memory.usedJSHeapSize after the scenario. Chromium only; ungated by --enable-precise-memory-info.

Latest results β€” third-party libraries (medians of 5 runs each)

Hardware: Author's machine β€” see results/<timestamp>.json for run conditions.

Mount time β€” React.render β†’ commit (lower is better, ms)

Scenariotanstackvirtuavirtuosowindow
mount-fixed-1k0.80.71.82.2
mount-fixed-10k1.61.02.02.4
mount-fixed-100k6.13.15.04.4
mount-dynamic-1k1.51.82.82.9
mount-dynamic-10k6.06.78.57.0

What we see: TanStack is fastest on every scenario at 1k–10k items, but slowest at 100k fixed. The audit predicted this: we eagerly populate measurementsCache (one object per item) on every mount, while virtua's lazy prefix-sum cache only does work for the visible window.

Dynamic measurement β€” commit β†’ stable total size (lower is better, ms)

Scenariotanstackvirtuavirtuosowindow
mount-dynamic-1k124121194122
mount-dynamic-10k118118188116

What we see: Roughly tied between TanStack, virtua, and react-window. Virtuoso takes ~60% longer because its scroll-anchoring keeps adjusting the inner spacer for several frames after the initial measurement pass.

Scroll perf β€” fps & long frames during 1.5 s programmatic scroll

Scenariotanstackvirtuavirtuosowindow
scroll-to-bottom-10k fps60606060
fast-scroll-dynamic-10k fps60606060
scroll-to-bottom-10k longFrames0000
fast-scroll-dynamic-10k longFrames0000

Caveat: at 10k items, none of these libraries even break a sweat. A 1.5 s rAF-paced scroll is too gentle to expose perf differences. Real stress tests would need expensive item renderers and/or 100k+ items.

Jump-to-end settle time (lower is better, ms)

Scenariotanstackvirtuavirtuosowindow
jump-to-end-dynamic-10k837215468

What we see: react-window is fastest. TanStack lands 15 ms behind, likely from the requestAnimationFrame reconcile loop running an extra frame or two before declaring the position stable. Virtuoso is 2Γ— slower than the fastest because its anchoring + measurement loop takes longer to converge.

Memory after mount (lower is better, MB)

Scenariotanstackvirtuavirtuosowindow
mount-fixed-10k6.66.46.77.0
mount-fixed-100k14.210.510.811.1
mount-dynamic-10k8.17.88.88.5

What we see: Tight at 10k. At 100k fixed, TanStack uses ~3 MB more than the others β€” same root cause as the slow mount: we hold a VirtualItem object per item, while virtua holds two numbers per item.

React Aria comparison (medians of 2 runs each)

Run with --libs tanstack,tanstack-rac,rac,rac-listbox on 2026-06-21. See results/LATEST.md for the full table set.

Mount time β€” React.render β†’ commit (lower is better, ms)

Scenariotanstacktanstack-racracrac-listbox
mount-fixed-1k3.71.09.67.8
mount-fixed-10k2.41.520.025.5
mount-fixed-100k5.84.2175.2β€”
mount-dynamic-1k1.81.47.38.1
mount-dynamic-10k4.95.226.226.3

What we see: tanstack-rac (TanStack virtual + WAI-ARIA roles only) mounts as fast as headless TanStack. The full RAC stack (rac) pays 10–30Γ— more at 10k because of collection + layout setup. rac-listbox (no virtualizer) is similar at 10k but skipped at 100k β€” 100k DOM nodes is out of scope.

Dynamic measurement β€” commit β†’ stable total size (lower is better, ms)

Scenariotanstacktanstack-racracrac-listbox
mount-dynamic-1k124.8122.63,004108.1
mount-dynamic-10k118.7119.43,009107.6

What we see: RAC's virtualizer waits ~3 s for layout to settle (its isFullyMeasured gate). Non-virtualized rac-listbox is fastest here because every row is already in the DOM β€” no scroll-range estimation needed.

Memory after mount (lower is better, MB)

Scenariotanstacktanstack-racracrac-listbox
mount-fixed-10k3.36.313.9534.0
mount-fixed-100k9.912.999.7β€”
mount-dynamic-10k4.87.715.4535.3

What we see: rac-listbox at 10k uses ~80Γ— more heap than virtualized libraries because all 10k React nodes stay mounted. RAC virtualized is ~2Γ— TanStack at 10k, ~10Γ— at 100k.

scrollToIndex landing accuracy β€” px offset from target (lower is better)

Scenariotanstacktanstack-racracrac-listbox
jump-to-middle-accuracy-dynamic-10k00βˆ’10
jump-to-last-accuracy-dynamic-10k00βˆ’10
jump-while-measuring-accuracy-dynamic-10k00βˆ’10
jump-wide-variance-accuracy-10k00βˆ’10

What we see: βˆ’1 means the target row was not in the DOM after scroll settled β€” RAC has no public scrollToIndex, so the harness uses layout-derived scrollTop. rac-listbox reports 0 px because every row stays mounted. Scroll FPS and jump-to-end settle time were identical across all four (60 fps, ~65–85 ms).

Bottom line

  • Small-to-medium variable-size lists (the most common use case) β€” TanStack is consistently the fastest to mount, tied on dynamic measurement, competitive on memory.
  • Huge fixed-size lists (100k+ items) β€” virtua wins decisively on mount time and memory because its lazy prefix-sum cache only materializes the visible window. TanStack's eager measurementsCache is the cost.
  • Scroll perf β€” at the list sizes / workloads tested, all four libraries sustain 60 fps with zero dropped frames.
  • Jump-to-index β€” react-window leads, TanStack lands ~15 ms slower, virtuoso 2Γ— slower than the leader.
  • React Aria overhead β€” WAI-ARIA roles alone (tanstack-rac) add negligible cost. The RAC collection + virtualizer stack adds ~10–30Γ— mount time at 10k and ~30Γ— at 100k vs headless TanStack. Non-virtualized ListBox is unusable at scale (~534 MB heap at 10k items).
  • RAC accuracy β€” virtualized RAC cannot satisfy scrollToIndex accuracy probes today (landingErrorPx = βˆ’1); non-virtualized rac-listbox is exact.

Notes on fairness

  • Each page is implemented with the library's recommended API. For example, TanStack uses useVirtualizer + measureElement; virtua uses VList with the data/item props; virtuoso uses Virtuoso with fixedItemHeight when applicable; react-window uses List + useDynamicRowHeight; RAC uses Virtualizer + ListLayout + ListBox; tanstack-rac adds listbox/option roles to TanStack rows without RAC's collection layer.
  • React 18 runs in production mode (no <StrictMode>).
  • Dataset is deterministic (LCG-seeded) and identical across libraries.
  • --enable-precise-memory-info + --js-flags=--expose-gc are passed to Chromium so memory readings aren't bucketed and we can force GC between runs.
  • Medians across 5 runs are reported (raw runs in results/<ts>.json).
  • Run on a built (vite build) preview server, not the dev server β€” so we measure production code paths.

Adding a scenario

Add an entry to SCENARIOS in src/scenarios/types.ts. The runner discovers it automatically.

Adding a library

  1. Create src/pages/MyLibPage.tsx that registers a HarnessHandle (see existing pages for the contract).
  2. Wire it into src/main.tsx's switch.
  3. Add the library name to ALL_LIBS in runner/run.mjs.
  4. If a library cannot run certain scenarios, add exclusions to LIB_SCENARIO_EXCLUSIONS in src/scenarios/libScenarioExclusions.mjs (also re-exported from scenarios/types.ts).

Known limitations

  • Scroll tests are programmatic (rAF-driven) and at the tested list sizes, every library trivially hits 60 fps. A harder test would render expensive items, scroll faster, or both. PRs welcome.
  • Memory deltas at small list sizes (≀10k items) are within the noise floor of performance.memory.
  • Single-machine numbers. The shape of the comparison transfers across machines, the absolute values don't.