Southeast Asia’s leading superapp, Grab, has achieved significant performance and efficiency milestones across its massive Android ecosystem. Operating in eight countries and serving millions of users through a single platform, the company manages a decade-old codebase consisting of more than 10 million lines of code. Built on a hybrid Bazel and Gradle setup, this infrastructure presented growing engineering hurdles over the years, notably rising Application Not Responding (ANR) rates following updates, expanding application download sizes, and steadily increasing startup times. To combat these challenges, the engineering team undertook a comprehensive, multi-phase optimization initiative. By implementing R8 code optimization, refining keep rules, and deploying Baseline Profiles and Startup Profiles, Grab successfully reduced its user-perceived ANR rate by approximately 32.5 percent. Additionally, the team cut the app’s download size by roughly 30.4 percent and accelerated cold start times by 35 percent. Read Also: Android Developers Get Up to 2x Faster Kotlin Coroutines with R8 Optimizations in AGP 9.2.0 Googlebook Launches a New Era of Android Laptops, Combining Mobile Flexibility with Desktop Power Eliminating Post-Release ANR Spikes for a Smoother User Experience Prior to rolling out these optimizations, Grab regularly encountered cold start delays and sharp spikes in ANR rates immediately after releasing new app updates. These performance regressions were primarily caused by the heavy computational overhead of reading numerous DEX files during the app’s initial launch sequence. While Google Play’s Cloud Profiles offered baseline performance improvements for standard user flows across the general user base, they did not cover all the specialized initialization paths required for Grab’s critical journeys. Key operations, such as initializing Dagger dependency graphs during app startup, fell outside standard distribution coverage. For these uncovered paths, user devices previously relied on Just-In-Time (JIT) compilation and background optimizations that took days to execute locally. To close this gap, Grab implemented custom Baseline Profiles, integrating them directly into Google Play’s Cloud Profiles. This expansion ensured that critical user paths were compiled directly into machine code the moment the application was installed. Nguyen Van Minh, Lead Software Engineer on Grab’s Passenger App Core team, noted that the application consistently experienced ANR rate spikes with every weekly release. To address this, the team turned to a combination of Profile-Guided Optimization and the R8 optimizer. This strategy delivered immediate results, including a 12 percent cold start improvement from R8 alone and an additional 15 percent boost from Baseline Profiles. Together, these tools accelerated startup times by 27 percent and effectively eliminated post-release ANR spikes. The rollout was executed across three strategic stages: enabling R8 optimization in compatibility mode, transitioning to R8 Full Mode, and refining keep rules with configuration analysis alongside continuous integration governance. Phased Rollout of R8 Optimization and Full Mode Migration During the initial phase shipped in 2025, Grab moved away from its legacy default Proguard file and adopted the optimized configuration file, which enabled core R8 optimizations. Given the decade-old, 10-million-line codebase, activating the optimizer required careful navigation of legacy configurations and heavy reflection usage. To maximize the impact, the team released this compatibility mode update alongside Baseline and Startup Profiles, yielding an immediate 25 percent reduction in user-perceived ANRs, a 16 percent decrease in app download size, and a 27 percent improvement in cold start times. Nine months later, the engineering team advanced to the second phase by migrating the application into R8 Full Mode. This shift unlocked deeper optimization capabilities. While standard libraries like Retrofit, Firebase, and Jetpack Compose integrated smoothly using built-in rules, migrating the broader codebase required resolving reflection-heavy code paths. To achieve a seamless transition, the team adopted consumer keep rules from recent JSON parsing library releases and addressed optimization hurdles related to Java dynamic proxies. Because dynamic proxies rely on runtime reflection to generate interface implementations, standard compilers often strip or rename necessary classes during compilation, leading to application crashes. Rather than applying broad exceptions that would bloat the application package, Grab isolated the specific classes relying on reflection and implemented highly targeted keep rules to preserve stability without sacrificing optimization efficiency. The migration to R8 Full Mode delivered compounding benefits, including an extra 14 percent reduction in app download size, an additional 10 percent improvement in startup times, and a further 10 percent decrease in user-perceived ANRs. Keep-Rule Refinement and Long-Term Codebase Governance In the final phase of the optimization journey, Grab focused on establishing long-term codebase health, continuous performance monitoring, and strict compilation governance. To systematically measure rule hygiene and prevent configuration regressions during ongoing release cycles, the team integrated the R8 Configuration Analyzer into their evaluation workflow. This diagnostic tool provided deep visibility into how effectively the keep rules allowed R8 to optimize, shrink, and obfuscate the application. Methodically trimming legacy keep rules yielded an additional 3.6 percent reduction in app download size. More importantly, tracking these diagnostic metrics provided the engineering team with objective data required to implement automated pre-merge checks. These guardrails ensure that newly introduced code adheres to strict keep-rule standards, protecting hard-won performance gains over time. Beyond immediate performance metrics, enabling the R8 optimizer yielded a permanent structural advantage for Grab’s massive codebase. Using the open-source tool app-sizer to measure the impact of R8, the engineering team observed that R8 permanently lowered the download size cost associated with every line of code in the application. In an era of AI-assisted development where code volumes expand rapidly, this optimization is increasingly vital. Without R8, code expansion proportionally inflates download sizes. R8 ensures that code growth maintains a significantly reduced memory footprint. To prevent rule degradation and preserve these optimizations moving forward, Grab plans to enforce automated pre-merge guardrails directly within its continuous integration pipeline. Under this governance framework, new keep rules will face strict restrictions, requiring explicit justification and review. By tracking R8 optimization scores continuously, the team maintains a feedback loop designed to catch regressions before code is merged, ensuring a faster and more stable superapp experience for millions of users across Southeast Asia. Post navigation Google Prepares Major Overhaul for Android Contact Permissions with Upcoming Release