Duolingo Juhi Agrawal May 4, 2025

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

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.

The article reveals why their metrics showed zero improvement despite successful side-loaded tests, and the unexpected culprit that kept swapping dex files.

About This Article

Problem

Duolingo's baseline profiles kept getting invalidated when the Android App Bundle packaging process ran. A third-party library was swapping two dex files, which caused the profile conversion to fail silently in production builds.

Solution

The team built a custom step into their build process that regenerates baseline profiles using the modified dex files. This worked around the library's bug while they waited for the maintainers to fix it.

Impact

Music lesson jank decreased noticeably. The team also figured out how to adopt Jetpack Compose without worrying about performance, which opens the door for UI modernization down the road.