Southeast Asia’s leading superapp, Grab, has achieved a dramatic performance overhaul across its massive Android ecosystem, significantly improving user experience for millions of customers across eight countries. Faced with the compounding technical debt of a decade-old codebase spanning more than 10 million lines of code, the Grab engineering team successfully addressed critical performance roadblocks, including climbing Application Not Responding (ANR) rates, bloated app sizes, and sluggish startup times.

By strategically integrating advanced Android compiler features—specifically enabling R8 optimization, refining keep rules, and deploying custom Baseline Profiles and Startup Profiles—Grab reduced its user-perceived ANR rate by approximately 32.5%. At the same time, the company slashed its app download size by roughly 30.4% and accelerated cold start times by 35%.

Eliminating Post-Release ANR Spikes for a Smoother User Experience

Prior to undertaking this comprehensive optimization initiative, Grab’s engineering teams frequently grappled with cold start delays and sharp spikes in App Not Responding incidents immediately following new weekly updates. These performance regressions were primarily driven by the intense computational overhead of reading numerous DEX files during the initial app launch phase.

Although Google Play’s built-in Cloud Profiles offered standard optimization benefits for typical user journeys across the broader Android ecosystem, they fell short of covering all the specialized initialization paths required for Grab’s complex superapp architecture. Critical workflows—such as initializing intricate Dagger dependency graphs during app launch—frequently fell outside the scope of standard distribution. As a result, consumer devices were forced to rely on Just-In-Time (JIT) compilation and local background optimizations over the course of several days following an installation.

Grab Reduces ANRs by 32% and improves startup time by 35% with R8 and Profile guided optimization | Android Developers' Blog

To bridge this gap, the Grab Passenger App Core team implemented custom Baseline Profiles and Startup Profiles. This profile-guided optimization strategy worked in tandem with the R8 code optimizer to provide immediate machine-code compilation for critical user pathways right at the moment of installation. According to Nguyen Van Minh, Lead Software Engineer on Grab’s Passenger App Core team, the post-release ANR spikes that historically plagued weekly rollouts were effectively neutralized, accompanied by a cumulative 27% boost in cold start speeds derived directly from R8 and Baseline Profile integrations.

Phased Migration to R8 Optimization and Full Mode

Grab executed its ambitious performance engineering strategy across distinct operational phases, moving cautiously to preserve stability across a legacy codebase. The first phase, shipped in 2025, involved transitioning away from the legacy default Proguard configuration to adopt proguard-android-optimize.txt, thereby unlocking foundational R8 optimization capabilities. Because the application had evolved over ten years, this transition required meticulous troubleshooting of legacy code structures and reflection usage.

By coupling this initial R8 compat-mode rollout with Baseline and Startup Profiles, Grab recorded an immediate 25% reduction in user-perceived ANR rates, a 16% decrease in app download size, and a 27% improvement in cold start times.

Building upon this foundation, the engineering team advanced to the second phase nine months later: migrating the massive application into R8 Full Mode. This transition unlocked deeper structural code shrinking and optimization. While standard third-party libraries like Retrofit, Firebase, and Jetpack Compose integrated smoothly using their respective built-in rules, adapting the wider proprietary codebase required resolving complex reflection-heavy paths.

Grab Reduces ANRs by 32% and improves startup time by 35% with R8 and Profile guided optimization | Android Developers' Blog

To achieve a successful migration to R8 Full Mode without breaking functionality, the team adopted consumer keep rules from the latest Gson releases to guarantee seamless JSON parsing. They also addressed challenges involving Java dynamic proxies, which use reflection to generate runtime interface implementations. Because traditional compilation tools cannot automatically detect these runtime behaviors, aggressive code shrinking can strip or rename vital classes, causing application crashes. Rather than applying broad exceptions that would inadvertently bloat the application package, Grab isolated the exact classes relying on reflection and implemented highly targeted keep rules.

This precision preserved application stability while unlocking an additional 14% reduction in app download size, a 10% improvement in startup speed, and a further 10% decrease in user-perceived ANRs.

Refining Keep Rules and Establishing Long-Term CI Governance

In the final phase of the optimization roadmap, Grab shifted its focus toward long-term codebase health, continuous performance monitoring, and strict compilation governance. To systematically measure rule hygiene and prevent configuration regressions across ongoing release cycles, the engineering team integrated the R8 Configuration Analyzer into their evaluation workflow. This diagnostic tool provided deep visibility into how effectively the application’s keep rules allowed the compiler to shrink, optimize, and obfuscate code.

By methodically trimming legacy keep rules and building upon the architecture of R8 Full Mode, the team secured an additional 3.6% reduction in app download size. More importantly, tracking these diagnostic scores provided developers with the objective data required to institute automated pre-merge CI guardrails. These guardrails ensure that newly introduced code adheres strictly to keep-rule standards, protecting hard-won performance gains against future bloat.

Grab Reduces ANRs by 32% and improves startup time by 35% with R8 and Profile guided optimization | Android Developers' Blog

Beyond immediate metrics, the adoption of R8 yielded a permanent structural advantage for Grab’s massive codebase. Using the open-source evaluation tool app-sizer, the team observed that R8 permanently lowered the download cost associated with every individual line of code. In an era shaped by AI-assisted development, where code generation volumes expand rapidly, this structural efficiency has become vital. Without compiler optimization, code expansion scales proportionally with application weight; with R8, Grab maintains a drastically reduced memory and download footprint despite continuous feature growth.

Ultimately, by proactively tackling growing technical debt through Baseline Profiles and advanced R8 configurations, Grab delivered a faster, more stable superapp experience. The multi-phase optimization effort successfully reduced ANR rates by nearly 32.5%, trimmed download sizes by roughly 30.4%, and accelerated cold start performance by 35%, empowering engineers across Southeast Asia to scale the platform without sacrificing speed or reliability.

By Basiran