Grab Reduces ANRs by 32% and improves startup time by 35% with R8 and Profile guided optimization
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
- Phase 1: R8 Compat mode cut ANRs by 25% and download size by 16%
- Phase 2: R8 Full Mode added another 10% ANR reduction and 14% size decrease
- Keep-rule refinement pushed optimization scores from 72% to 78.2%
- R8 permanently reduced cost per line of code in download size
- Team built CI guardrails to prevent keep-rule regressions across releases
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
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.
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.
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.
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.