How Southeast Asia Superapp Grab Overcame a Decade of Code Bloat to Deliver Blazing-Fast Performance and Slashes App Size

Managing a decade-old digital ecosystem that spans eight diverse countries, supports millions of daily active users, and integrates everything from ride-hailing and food delivery to complex digital financial services is no small feat. For Grab, Southeast Asia’s premier superapp, this immense capability was anchored to a massive, maturing codebase comprising over 10 million lines of code and hundreds of third-party libraries. Built upon a hybrid Bazel and Gradle architecture, the engineering organization found itself increasingly constrained by three persistent engineering bottlenecks: rising Application Not Responding (ANR) rates following weekly deployments, an expanding binary download size, and a cold start latency that crept upward year over year. To safeguard user experience and scale sustainably, the engineering team embarked on a multi-year, systematic performance overhaul. By leveraging advanced R8 compiler optimizations, fine-tuning custom keep rules, and deploying targeted Baseline and Startup Profiles, Grab dramatically reversed these trends, cutting user-perceived ANRs by 32.5 percent, reducing app download size by 30.4 percent, and accelerating startup times by 35 percent.
The Architectural Roots of Scale and Complexity
To understand the magnitude of Grab’s optimization initiative, one must examine the structural realities of modern multi-service mobile applications. Over a ten-year development lifecycle, applications naturally accumulate technical debt, redundant dependencies, and fragmented initialization paths. For Grab’s Passenger App Core team, every weekly app release brought a recurring structural challenge: post-release ANR spikes. These slowdowns were primarily driven by the heavy I/O overhead of parsing and reading massive arrays of Dalvik Executable (DEX) files during the initial cold launch phase.
While standardized frameworks like Google Play’s Cloud Profiles offer baseline optimizations for generalized application flows, they inherently fall short of addressing the unique, highly customized initialization sequences required by complex superapps. Critical user journeys within Grab—such as instantiating intricate Dagger dependency injection graphs during launch—often fell outside standard cloud optimization coverage. Consequently, unoptimized client devices were forced to rely heavily on Just-In-Time (JIT) compilation and localized background optimizations over several days of usage, leaving early adopters vulnerable to performance degradation.
A Three-Phase Engineering Roadmap
Recognizing that superficial patches would not suffice, Grab structured its performance transformation into three distinct, highly disciplined phases spanning from 2025 through 2026. This deliberate methodology allowed the engineering organization to isolate variables, mitigate catastrophic regression risks, and safely push aggressive compiler configurations into production at scale.

Phase 1: Transitioning to R8 Optimization (Shipped 2025)
The initial phase marked a decisive departure from legacy Proguard configurations. Grab migrated its compilation pipeline to utilize proguard-android-optimize.txt, unlocking the foundational optimization capabilities of the R8 compiler. Given the sheer scale of a codebase exceeding 10 million lines of code, simply enabling the optimizer required meticulous auditing of legacy reflection patterns and obfuscation rules.
To maximize immediate user-facing impact, this rollout was paired with the simultaneous deployment of custom Baseline Profiles and Startup Profiles. Profile-Guided Optimization (PGO) acted as a force multiplier for the R8 compiler, translating critical user journey code paths directly into pre-compiled machine code upon installation. The results of Phase 1 were immediate: an initial 25 percent reduction in user-perceived ANRs, a 16 percent reduction in application download size, and a 27 percent improvement in cold start execution times.
Phase 2: Full-Mode Migration and Reflection Handling (Shipped 2026)
Building upon the stable foundation established in the first phase, Grab advanced its build pipeline into R8 Full Mode approximately nine months later. While popular libraries such as Retrofit, Firebase, and Jetpack Compose integrated seamlessly with full optimization rules out of the box, migrating the remainder of the proprietary codebase required solving complex reflection hurdles.
A primary technical hurdle involved Java dynamic proxies, which dynamically generate runtime interface implementations via reflection. Because the R8 compiler cannot statically deduce runtime usage during compile time, it risks stripping or renaming necessary classes, leading to fatal runtime crashes. Rather than applying broad, indiscriminate exceptions that would bloat the binary, Grab’s engineers isolated specific reflection-heavy code paths and crafted highly targeted keep rules. Furthermore, the team adopted updated consumer keep rules from the latest Gson library releases to ensure flawless JSON serialization and deserialization.
The payoff for entering R8 Full Mode was substantial. The migration yielded an additional 14 percent reduction in app download size, a 10 percent boost in startup speed, and a further 10 percent drop in user-perceived ANRs.
Phase 3: Keep-Rule Refinement and CI/CD Governance
With the core optimizations successfully deployed, the final phase of Grab’s journey shifted toward long-term maintainability, codebase hygiene, and automated governance. To prevent configuration degradation over time, the team integrated the R8 Configuration Analyzer into their evaluation workflows. This diagnostic tool provided deep visibility into how effectively the application’s keep rules allowed R8 to shrink, optimize, and obfuscate the codebase.
By methodically trimming obsolete keep rules, Grab secured an additional ~3.6 percent reduction in application download size. More importantly, these metrics established objective, data-driven guardrails for future development cycles.

Quantifiable Outcomes and Performance Metrics
The cumulative impact of Grab’s multi-phase performance initiative transformed the superapp’s operational efficiency across every key performance indicator. According to internal production telemetry, the cumulative outcomes achieved across the optimization lifecycle include:
- User-Perceived ANRs: Reduced by approximately 32.5 percent, effectively eliminating post-release performance spikes.
- Application Download Size: Cut by roughly 30.4 percent, significantly lowering bandwidth barriers for users across developing Southeast Asian markets.
- Cold Start Latency: Improved by approximately 35 percent, driven by a combination of R8 compiler enhancements and tailored Baseline Profiles.
| Optimization Phase | ANRs | Size Reduction | Cold Start Improvement |
|---|---|---|---|
| Phase 1: R8 Optimizer (Shipped 2025) | ~25% reduction | 16% reduction | ~27% improvement |
| Phase 2: R8 Full Mode (Shipped 2026) | 10% reduction | 14% reduction | 10% improvement |
| Keep-Rule Optimization | N/A | 3.6% reduction | N/A |
| Overall Cumulative Impact | ~32.5% reduction | ~30.4% reduction | ~35% improvement |
Technical Challenges at Enterprise Scale
Executing an optimization of this scale across a mature enterprise codebase revealed structural challenges that extended beyond simple syntax configuration. The primary obstacle centered on managing reflection, dynamic class loading, and third-party library dependencies. In a legacy architecture spanning a decade, developers frequently relied on permissive keep rules to prevent runtime breakage. Identifying and safely removing these overly broad rules required deep collaboration across disparate product engineering squads.
To quantify the structural impact of these changes, Grab utilized an open-source internal utility known as app-sizer. By measuring Kotlin and Java code contributions to download size relative to production lines of code (LOC), the team discovered that R8 permanently altered the economic cost of code expansion.
Broader Implications in the Era of AI-Assisted Development
The implications of Grab’s technical achievement extend far beyond the immediate gains in startup speed and file size. In the contemporary software engineering landscape—increasingly defined by AI-assisted code generation tools that accelerate the sheer volume of written code—codebase bloat has become an existential threat to mobile performance.

Without aggressive, automated compiler optimizations like R8, rapid code expansion invariably leads to bloated application binaries, sluggish memory footprints, and degraded user experiences. Grab’s successful integration proves that enterprise-scale applications can counteract code bloat through rigorous compiler governance and continuous profiling. By decoupling feature velocity from binary bloat, Grab has established a sustainable architectural model for superapps globally.
Long-Term Codebase Health and Governance
To ensure that these hard-won performance gains are not eroded by future updates, Grab is embedding automated pre-merge guardrails directly into its Continuous Integration and Continuous Deployment (CI/CD) pipelines. Under this newly enforced governance model, any introduction of new keep rules requires explicit justification and architectural review.
Furthermore, the engineering organization utilizes real-time CI dashboards to continuously track shrinking, optimization, and obfuscation scores. This closed-loop feedback mechanism ensures that any accidental configuration regression is intercepted and rectified before code ever reaches the merge stage.
Conclusion
Faced with the formidable challenge of scaling a decade-old, multi-service superapp, Grab’s Passenger App Core team demonstrated that deep compiler optimization and profiling can radically revitalize legacy codebases. By methodically advancing through R8 optimization phases, implementing tailored Baseline and Startup Profiles, and establishing rigorous CI keep-rule governance, the company achieved unprecedented performance gains. Sashing user-perceived ANRs by nearly 33 percent, cutting download sizes by over 30 percent, and accelerating startup times by 35 percent has ultimately delivered a faster, more reliable digital ecosystem for millions of everyday users across Southeast Asia, setting a new benchmark for mobile application engineering at scale.







