Building a Better Instagram App for Android
Article Summary
Instagram cut their Android app startup time in half and reduced APK size by 50%. Here's how they did it.
In 2014, Instagram's Android team completely rewrote their app to serve 1 billion+ users across thousands of device types, from budget phones on slow networks to flagship devices. Engineer Tyler Kieft shares the technical decisions behind their dramatic performance improvements.
Key Takeaways
- Flat design reduced startup time by 120ms (10-20% faster) by cutting assets from 29 to 8
- Two-step singleton initialization: create objects immediately, defer heavy work to background threads
- Converted News webview to native, eliminating duplicate networking stacks and thread contention
- Asset tinting reused shapes with runtime colors, cutting total app assets in half
- Galaxy S5 startup dropped to 0.5 seconds, Galaxy Y to 1.5 seconds
Instagram achieved 50% faster startup and 50% smaller APK by ruthlessly eliminating work at launch through lazy loading, asset reduction, and strategic native rewrites.
About This Article
Android devices come in wildly different sizes, from 240×320 to 1080×1920 pixels. That's a 27-fold difference. Instagram had to support all of them, plus deal with unreliable networks in emerging markets and vastly different hardware capabilities.
Instagram sorted screens into four groups based on aspect ratio and DPI. Smaller devices got condensed layouts, while larger screens got expanded ones. This made the controls easier to reach with your thumb.
The redesign made photo and video editing work better across all device types. Medium and large screens got layouts that actually used the available pixels instead of wasting them.