OkCredit Jun 14, 2022

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

Critical Insight

By instrumenting metrics across four startup phases and systematically eliminating bottlenecks, OkCredit reduced slow cold start sessions from 4% to 1.2%.

The team discovered that using Kotlin coroutines instead of ExecutorService was actually slowing them down due to initialization costs.

About This Article

Problem

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.

Solution

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.

Impact

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.

Recent from OkCredit

Related Articles