Mobile Application Development

How Grab Revolutionized Its Superapp Architecture to Cut App Size by 30% and Boost Startup Performance Across Southeast Asia

Managing a digital ecosystem that caters to millions of active users across eight distinct Southeast Asian nations presents a massive engineering hurdle, particularly when dealing with a decade-old codebase. Grab, widely recognized as Southeast Asia’s premier superapp, operates a complex multi-service platform encompassing ride-hailing deliveries, on-demand mobility, and comprehensive digital financial services housed entirely within a single application framework. For years, the engineering organization operated within a hybrid Bazel and Gradle build environment, supporting an extensive codebase comprising over 10 million lines of code alongside hundreds of third-party libraries. However, this scale introduced compounding systemic hurdles that threatened user retention and application stability. Specifically, the superapp battled escalating Application Not Responding (ANR) rates immediately following production releases, a continuously expanding application download size driven by rapid feature deployment, and a steady, year-over-year degradation in cold start times.

To confront these persistent operational obstacles head-on, the Grab Passenger App Core engineering team embarked on a multi-year performance optimization initiative. By systematically integrating advanced Android build mechanisms—namely enabling comprehensive R8 compiler optimization, refining complex keep rules, and deploying customized Baseline Profiles and Startup Profiles—the organization achieved remarkable performance gains. The initiative successfully reduced user-perceived ANR rates by approximately 32.5%, trimmed app download size by more than 30%, and accelerated cold start execution times by 35%. This comprehensive engineering overhaul not only stabilized the platform for millions of daily consumers but also fundamentally transformed how the codebase scales in an era defined by rapid feature expansion and AI-assisted development paradigms.

Understanding the Roots of Post-Release Instability and Performance Degradation

Before initiating the comprehensive build optimization campaign, Grab’s software infrastructure suffered from predictable performance bottlenecks tied directly to application initialization routines. Following every weekly application update, engineering telemetry consistently recorded sharp spikes in cold start latency and user-perceived ANR rates. Root cause analysis revealed that these anomalies stemmed from the heavy computational overhead required to read and process numerous DEX (Dalvik Executable) files during the initial launch phase.

While standard optimization frameworks provided by Google Play, such as Cloud Profiles, offered broad efficiency improvements across the general Android user base, they fell short of addressing the highly specialized initialization paths critical to Grab’s core user journeys. Essential architectural requirements—such as instantiating complex Dagger dependency injection graphs during app startup—fell outside the coverage parameters of standard distribution profiles. Consequently, devices lacking pre-compiled machine code for these specific routines were forced to rely heavily on Just-In-Time (JIT) compilation and local background optimization processes that could take days to settle.

To bridge this optimization gap, Grab engineered custom Baseline Profiles designed to capture the exact critical user journeys unique to its superapp ecosystem. By feeding these tailored profiles directly into Google Play’s distribution pipeline, the engineering team ensured that critical execution paths were compiled into native machine code immediately upon installation. According to Nguyen Van Minh, Lead Software Engineer on Grab’s Passenger App Core team, the impact was immediate. "We consistently experienced ANR rate spikes with every weekly app release," Minh noted, explaining how the combination of profile-guided optimization and compiler enhancements ultimately neutralized post-release instability.

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

A Three-Phase Engineering Roadmap for Scalable Optimization

Grab’s architectural transformation was executed through a meticulous, three-phase strategic roadmap spanning multiple years, ensuring stability was preserved while progressively unlocking deeper optimization layers within the compiler toolchain.

Phase 1: Transitioning to R8 Optimization (Shipped 2025)
The initial phase of the modernization initiative focused on moving away from legacy Proguard configurations in favor of modern compiler tooling. The team adopted the standardized proguard-android-optimize.txt configuration, unlocking the core optimization engine of R8. Given that the codebase was over ten years old and spanned more than 10 million lines of code, enabling aggressive compiler optimization required a careful audit of legacy configurations and reflection-heavy modules.

To maximize the efficacy of this foundational step, Grab simultaneously deployed R8 Compat mode alongside custom Baseline Profiles and Startup Profiles. This synchronized effort yielded immediate, quantifiable dividends: a 25% reduction in user-perceived ANR rates, a 16% decrease in overall application download size, and a 27% improvement in cold start execution speeds.

Phase 2: R8 Full Mode Migration (Shipped 2026)
Building upon the stabilization achieved in the first phase, Grab advanced to R8 Full Mode approximately nine months later. This transition unlocked aggressive code shrinking, optimization, and obfuscation capabilities that are otherwise restricted in compatibility modes. While mainstream third-party libraries—such as Retrofit, Firebase, and Jetpack Compose—integrated smoothly with R8 using their native keep rules, migrating the massive proprietary codebase required resolving complex interactions involving Java dynamic proxies and JSON parsing libraries.

To maintain runtime stability without bloating the application package, the team adopted modernized consumer keep rules from recent Gson updates. Furthermore, rather than applying broad, permissive compiler exceptions that would compromise optimization efficiency, engineers isolated specific classes relying on reflection and implemented highly targeted, granular keep rules. This rigorous approach preserved application integrity 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.

Phase 3: Keep-Rule Refinement and Governance
The final phase of the optimization journey shifted 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 organization integrated the R8 Configuration Analyzer into its evaluation workflow. This analytical tool provides deep operational visibility into how effectively application keep rules allow R8 to shrink and optimize the binary.

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

By methodically trimming legacy keep rules, Grab secured an additional ~3.6% reduction in app download size. More importantly, establishing objective metrics enabled the engineering leadership to institute automated pre-merge CI/CD guardrails. These automated checks ensure that newly introduced code strictly adheres to keep-rule standards, safeguarding hard-won performance gains against future technical debt.

Quantifiable Outcomes and Performance Metrics

The cumulative impact of Grab’s multi-phase optimization initiative transformed the superapp’s operational metrics across all evaluated dimensions.

Optimization Milestone ANR Reduction App Size Reduction Cold Start Improvement
Phase 1: R8 Optimizer (2025) ~25.0% 16.0% ~27.0%
Phase 2: R8 Full Mode (2026) 10.0% 14.0% 10.0%
Keep-Rule Optimization — 3.6% —
Cumulative Overall Impact ~32.5% ~30.4% ~35.0%

These metrics underscore a profound technical achievement: the engineering team successfully reversed the historical trend of application bloat, delivering a significantly leaner, faster, and more reliable experience to millions of consumers across Southeast Asia.

Long-Term Structural Implications and Industry Context

Beyond immediate performance enhancements, the successful deployment of R8 optimization established a permanent structural advantage for Grab’s software development lifecycle. Utilizing the open-source evaluation tool app-sizer, the engineering team analyzed the correlation between code volume and binary footprint. The findings demonstrated that R8 fundamentally lowered the marginal download-size cost associated with every newly authored line of source code.

This structural decoupling of code volume from binary expansion carries significant implications for modern software engineering, particularly within the burgeoning era of AI-assisted development. As automated code generation tools enable development teams to scale code volume at unprecedented speeds, traditional applications risk rapid, unmitigated size bloat. Grab’s implementation proves that aggressive compiler optimization can successfully absorb accelerated code expansion while maintaining a strictly controlled memory and download footprint.

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

Furthermore, by institutionalizing automated CI/CD guardrails and tracking R8 optimization scores continuously, Grab has established a sustainable model for engineering governance. Catching configuration regressions prior to code merges ensures that performance gains are institutionalized rather than treated as temporary fixes.

Broader Industry Impact and Conclusion

The technical journey undertaken by Grab’s Passenger App Core team offers a compelling blueprint for large-scale enterprise mobile applications facing the inevitable friction of a maturing codebase. By tackling structural latency, memory overhead, and binary bloat through a systematic combination of custom Baseline Profiles, Startup Profiles, and progressive R8 compiler integration, the organization successfully reversed years of performance degradation.

As digital ecosystems across emerging markets continue to expand in functional complexity, maintaining optimal client-side performance remains paramount for user acquisition and retention. Grab’s decisive architectural pivot demonstrates that disciplined build engineering and proactive configuration governance can unlock compounding operational efficiencies, securing a faster, more resilient digital infrastructure for millions of users across Southeast Asia.

Related Articles

Back to top button
Lock It Soft
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.