Meta Nov 16, 2021

Android Developers Blog: Improving App Startup: Lessons from the Facebook App

Article Summary

Facebook's Android app serves 2.9 billion users monthly. Their startup optimization strategy cut bad starts by focusing on one counterintuitive metric.

Google's Android team partnered with Facebook engineers to document how they measure and optimize app startup performance. This collaboration reveals the metrics, targets, and specific techniques Facebook uses to deliver fast, reliable launches across billions of devices worldwide.

Key Takeaways

Critical Insight

Facebook prioritizes full content delivery over initial render speed, measuring complete user experience including network calls and image loads to drive meaningful improvements.

The article reveals why Facebook sometimes deliberately shows slower, fresh content instead of instant cached data, and the surprising tradeoff that improved engagement.

About This Article

Problem

Facebook app developers needed to figure out why the app was slow or failing to start on billions of devices. The problem was complicated by different network conditions and hardware capabilities. They needed detailed instrumentation to find where the bottlenecks were.

Solution

The team built two metrics to track startup performance. Time-To-Initial-Display (TTID) measured when the first screen appeared, while Time-To-Full-Display (TTFD) measured when everything was ready. They used logcat's Displayed value and the Activity.reportFullyDrawn() API to collect this data and find where to optimize.

Impact

After tracking these metrics and fixing crashes and reliability issues first, Facebook reduced bad starts. A bad start meant the app took longer than 2.5 seconds to launch or had missing content. The improvements led to better user engagement and how people felt about the app.