notajson.dev
← All work

case study 01 · lead · multi-portal talent platform · React, React Query, react-virtuoso

Performance at scale

Large talent lists froze the browser. Part of the fix was virtualization. The other part was naming the limit that wasn't in the frontend at all.

// measured with the same benchmark

172,522DOM nodes, with every row mounted
1.3–1.45 GBJS heap in a single tab
39 msaverage frame while scrolling (~25 fps)

Worksheet at 1,316 rows, before the virtualizer was bound to the window.

Context

Agencies and casting directors work through talent lists, worksheets and submissions that run to thousands of profiles. Scrolling, filtering and selecting had to stay responsive on desktop and on mobile Safari.

Constraints

  • The backend can't serve large aggregate queries yet, so data arrives in many small requests.
  • Rows have dynamic heights, and some views use sticky elements.
  • Bulk actions run on 1,000+ profiles; that's where 504 timeouts started.
  • Mobile Safari renders long lists differently from desktop browsers.

Decisions

Open each one for the trade-off behind it.

Only rows near the viewport are rendered. react-virtuoso handles infinite scroll with dynamic row heights; window-bound virtualizers cover views where the page itself scrolls. TanStack Virtual was evaluated for the same job.

What I built

  • Virtualized infinite-scroll views with react-virtuoso, and window-bound row virtualizers where the page itself scrolls.
  • Memoized React Query pipelines for the large list views.
  • The Projects page's data loading: a lean list query, per-row details, and the full project only on expand, with larger pages fetched ahead of the scroll.
  • A repeatable browser benchmark: LCP and FCP, frame times, memory growth and calls per endpoint.

Result

The worksheet's virtualizer was bound to a container that never scrolled, so all 1,321 rows stayed mounted. Once it was bound to the window, the same 1,316-row list held about 44 rows, the DOM dropped from 172,522 nodes to about 5,900, the heap from 1.3 GB to 85–234 MB, and scrolling from 39 ms frames to 11.5 ms with no long tasks. The 686 per-row calls stayed, on purpose. On production, the Projects page keeps about 31 rows mounted for a 294-project account and scrolls with no long tasks. Bulk actions beyond 1,000 profiles still depend on backend capacity, and the reports now say so instead of calling it a frontend bug.

What I'd do differently

Benchmark at production data sizes from the first run. At 40 rows the worksheet looked flawless, and LCP stayed flat at 1,316 rows while the tab held 1.3 GB. A dashboard that tracks only first paint would have missed it. Now I count mounted rows, not just paint times.