← Back to portfolio

React Native · Performance

Fixing scroll jank by tuning list virtualization, not rewriting the screen

A long, image-heavy list was janky on mid-range Android devices. The fix wasn’t a new list library or a redesign — it was making the existing FlatList mount only what the viewport actually needed, and feeding it the layout information it was missing.

Context

A feed-style screen (think: order history, activity feed, chat-like list) rendered a few thousand rows, each with an avatar, two lines of text and a status pill. On iOS it felt acceptable; on mid-range Android it stuttered on scroll, took a visible beat to respond to fast flicks, and occasionally dropped frames hard enough that users reported the screen as “frozen.”

Problem

The list was already using FlatList, so the instinct was to blame the library. The real issue was upstream of it: every row was an uncached component tree re-created on each render, there was no getItemLayout so the list couldn’t predict row size, and the default window settings were left untouched on a dataset an order of magnitude larger than what they’re tuned for out of the box. Virtualization was technically on; in practice the list was mounting far more rows than the viewport needed and re-laying-out constantly.

Approach — make the window do its job

Illustrative outcome

Figures below are illustrative, from profiling a representative feed screen during this work — not a specific client’s production metrics.

What I took from it

“We’re already using FlatList” is not the same as the window being tuned for the data you actually have. The highest-leverage fixes were layout information and memoization — both free, both unrelated to swapping libraries. Reaching for a different list implementation is a real option, but it’s worth earning with a profile, not reaching for first.

The interactive demo below makes the mechanism visible: toggle windowing on a few thousand rows and watch mounted DOM nodes and estimated render cost move together, the same relationship that drives scroll performance in a native list.

Try the virtualization demo →