How We Slashed Android Startup Time by 30% with Baseline Profiles
Article Summary
Duolingo's Android team cut startup time by 30% with baseline profiles. But the path from 'easy setup' to production was anything but smooth.
The team implemented Android baseline profiles to pre-compile critical code at install time, reducing the JIT compilation burden. What looked like a straightforward integration turned into a months-long debugging saga involving invalid profiles, incompatible third-party libraries, and build process mysteries.
Key Takeaways
- Startup time improved 30%, JIT thread usage dropped from 25% to 3%
- Two different third-party libraries were silently invalidating baseline profiles
- Side-loaded testing showed gains, but production builds failed completely
- Macrobenchmark library bugs forced creative workarounds during validation
- Added custom build step to regenerate profiles after dex modifications
Critical Insight
Baseline profiles delivered massive performance wins, but debugging required Google's direct support and custom build process modifications to work around third-party library issues.