FlatList vs SectionList for Large Categorized Lists: Memory Overhead vs Sticky Header Support
20K reputation · 29 Apr 2021, 11:44 UTC
Goal: Determine whether to use FlatList with custom header rendering or SectionList for a large categorized dataset while maintaining smooth scrolling and low memory usage on both iOS and Android.
Constraint: SectionList provides built‑in sticky section headers but requires a specific data shape and may allocate additional internal structures; FlatList is lighter for homogeneous lists but demands manual implementation of header stickiness and section change handling.
Uncertainty: The trade‑off between the extra memory overhead of SectionList’s internal section tracking and the performance impact of custom header logic in FlatList, especially when section titles or item counts change frequently.
Does SectionList introduce a measurable increase in JavaScript heap size compared to a FlatList implementation that renders headers as regular items? How does frequent section data mutation affect frame times for each approach when rendering a large categorized dataset?