Fast Rendering News Feed on Android

This post details the architectural changes made to the Facebook for Android News Feed to improve scrolling performance. The previous approach used custom view classes with a `bindModel` method, which led to issues with view recycling, complicated hierarchies, deep view hierarchies, and computationally intensive binding. The new architecture splits each story into multiple items in the ListView, enabling effective view recycling and amortizing binding time over several frames. It also decouples binding logic from views by introducing 'dumb' custom views and Binder classes with `prepare`, `bind`, and `unbind` methods. A `PartDefinition` class was introduced to manage the hierarchy of story parts and generate binders. These changes resulted in a 17% reduction in out-of-memory errors, an 8% reduction in total errors, and a 10% reduction in maximum frame render time.
More from the News Feed and Timeline Evolution trail
- Friend Bubbles: Enhancing Social Discovery on Facebook Reels
- A New Ranking Framework for Better Notification Quality on Instagram
- Inside Facebook’s video delivery system
- Improving Instagram notification management with machine learning and causal inference
- A linear programming approach for optimizing features in ML models