Southeast Asia’s leading superapp, Grab, has achieved significant performance and efficiency gains across its massive Android ecosystem. By tackling the complex challenges of a decade-old codebase scaling across eight countries, the engineering team successfully reduced user-perceived Application Not Responding (ANR) rates by roughly 32.5 percent, cut app download sizes by approximately 30.4 percent, and improved cold start times by 35 percent. Operating across a hybrid Bazel and Gradle setup, Grab’s application houses over 10 million lines of code combined with hundreds of third-party libraries to deliver deliveries, mobility, and financial services to millions of daily users. However, this vast scale introduced persistent engineering hurdles. Prior to the optimization initiative, the application suffered from growing cold start delays and notable post-release ANR spikes with every weekly software update. These performance bottlenecks were primarily driven by the intensive overhead of reading a multitude of DEX files during app initialization. Read Also: Android Developers Can Now Leverage Enhanced Playback, Compose UI, and Cast Integration as Media3 1.11 Launches Google Play Expands Developer Tools to Boost App Discovery, Engagement, and Business Growth While Google Play’s Cloud Profiles provided baseline optimizations for standard flows across the general user base, they fell short of covering all initialization paths critical to Grab’s complex user journeys. Essential pathways, such as initializing Dagger dependency graphs during app launch, required deeper, tailored interventions. To address this, the engineering team deployed a comprehensive optimization strategy centered around enabling R8 optimization, refining keep rules, and implementing custom Baseline Profiles and Startup Profiles. The transformation was executed across distinct phases. The first phase involved moving away from legacy Proguard configurations to adopt proguard-android-optimize.txt, enabling R8 optimizations. Given the age and complexity of the codebase, this required careful navigation of legacy configurations and reflection usage. Shipped alongside custom Baseline Profiles and Startup Profiles in compat mode, this initial phase delivered an immediate 25 percent reduction in user-perceived ANR rates, a 16 percent reduction in download size, and a 27 percent improvement in cold start times. Profile-guided optimization proved vital, with the R8 optimizer delivering a 12 percent cold start improvement and Baseline Profiles contributing an additional 15 percent. Building on these early successes, the team transitioned the application into R8 Full Mode. While standard libraries like Retrofit, Firebase, and Jetpack Compose integrated seamlessly using built-in rules, migrating the remainder of the massive codebase required resolving complex, reflection-heavy code paths. The team adopted consumer keep rules from the latest Gson release for smooth JSON parsing and addressed challenges related to Java dynamic proxies. Because dynamic proxies use reflection to generate interface implementations at runtime—behavior that R8 cannot detect during compilation—broad exclusions could easily bloat the app size. Instead, engineers isolated the specific classes relying on reflection and implemented highly targeted keep rules, preserving app stability without sacrificing optimization efficiency. The migration to R8 Full Mode yielded compounding benefits, including an additional 14 percent reduction in app download size, a 10 percent improvement in startup times, and a further 10 percent decrease in user-perceived ANRs. In the final phase of the optimization journey, Grab focused on establishing long-term codebase health through continuous performance monitoring and strict compilation governance. By integrating the R8 Configuration Analyzer into their evaluation workflow, the engineering team gained deep visibility into how effectively their keep rules allowed the system 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 objective metrics enabled the team to implement automated pre-merge CI guardrails, ensuring that newly introduced code adheres to strict standards and that hard-won performance gains remain protected over time. Beyond immediate performance metrics, enabling the R8 optimizer permanently altered the structural economics of Grab’s codebase. Using the open-source tool app-sizer to measure the impact of R8, the engineering team observed that the optimizer permanently lowered the cost of every line of code in terms of download size. In an era of AI-assisted development where code volume expands rapidly, this optimization ensures that code expansion maintains a drastically reduced memory footprint rather than triggering proportional increases in download size. Reflecting on the overarching impact of the project, Nguyen Van Minh, Lead Software Engineer on Grab’s Passenger App Core team, noted that the consistent post-release ANR spikes experienced with every weekly update have been effectively eliminated. Through proactive optimization and rigorous pipeline governance, Grab has delivered a faster, more stable superapp experience across Southeast Asia while equipping its developers to build new features efficiently without the penalty of rapid application bloat. Post navigation A more reliable way to add and edit contacts on Android | Android Developers’ Blog