Grab

Grab Reduces ANRs by 32% and improves startup time by 35% with R8 and Profile guided optimization

M7 Related OWASP risk: Insufficient Binary Protections Learn more →

Article Summary

Nguyen Van Minh from Grab reveals how they turned a 10-year-old, 10-million-line codebase into a performance powerhouse. The results? A 32% drop in ANRs and 35% faster startup times.

Grab, Southeast Asia's leading superapp serving millions across eight countries, faced mounting performance issues as their decade-old hybrid Bazel/Gradle codebase grew. Their engineering team executed a three-phase optimization strategy using R8, Baseline Profiles, and aggressive keep-rule refinement to eliminate post-release ANR spikes and bloat.

Key Takeaways

Critical Insight

Grab achieved a cumulative 32.5% ANR reduction, 30.4% smaller downloads, and 35% faster cold starts by systematically optimizing R8 configuration across their massive legacy codebase.

Continue reading

What This Article Covers

Problem

Because Grab runs a hybrid Bazel/Gradle setup, experimental R8 changes could take up to 2 hours to build in remote CI. That slowed down debugging across hundreds of optimized classes.

Solution

Grab lined up its daily QA builds with production R8 behavior and automated the upload of mapping.txt files to Firebase Crashlytics and Play Console, cutting down deobfuscation time.

Impact

Google Play's Cloud Profiles alone missed important paths like Dagger graph initialization. Custom Baseline Profiles filled that gap, so these journeys got compiled to machine code right at install.

The team's hybrid build system created a 2-hour feedback loop that nearly derailed the entire project until they found a clever workaround.

This page summarizes “Grab Reduces ANRs by 32% and improves startup time by 35% with R8 and Profile guided optimization” by Grab, published Oct 19, 2026. All credit for the original work goes to the authors.

Read the original on developer.android.com (opens in new tab)

AI tools for Android

Browse all AI tools →