How OkCredit Android App Improved Cold Startup by 70%
Article Summary
OkCredit slashed their Android app cold startup time by 70%. Here's the engineering playbook that made it happen.
The OkCredit team spent six months methodically measuring, profiling, and optimizing their app startup performance. They broke cold startup into four distinct phases and tackled bottlenecks one by one, validating each improvement through production metrics.
Key Takeaways
- Used Dagger Lazy to defer expensive object initialization until actually needed
- Moved SDK initialization from main thread to ExecutorService background threads
- Removed Firebase Performance library which added hidden initialization costs
- Avoided Joda DateTime objects during startup due to slow timezone data loading
- Flattened view hierarchy with ConstraintLayout to speed layout and measure stages
By instrumenting metrics across four startup phases and systematically eliminating bottlenecks, OkCredit reduced slow cold start sessions from 4% to 1.2%.
About This Article
OkCredit's Android app took nine sequential stages to go from process creation to rendering the first frame. Multiple third-party libraries and content providers were initializing on the main thread during App.OnCreate(), which slowed things down.
The team made WorkManager initialize lazily through On-Demand Initialization. They turned on StrictMode to catch I/O operations and stopped using org.joda.time DateTime objects, which were loading timezone data inefficiently at startup.
Cold start sessions that took too long dropped from 4% to 1.2% over three months. The improvements came from careful measurement and fixing specific bottlenecks across all four startup phases.