Southeast Asian superapp giant Grab has successfully tackled long-standing performance bottlenecks in its massive Android codebase, achieving a 35% improvement in cold start times and reducing user-perceived App Not Responding (ANR) rates by roughly 32.5%. Facing the complexities of a decade-old application containing over 10 million lines of code and hundreds of third-party libraries managed through a hybrid Bazel and Gradle setup, the engineering team embarked on a multi-phase optimization journey. By implementing R8 code optimization, refining keep rules, and deploying custom Baseline Profiles alongside Startup Profiles, the company managed to streamline its operations while simultaneously cutting app download sizes by approximately 30%. Operating across eight different countries and serving millions of daily active users with a comprehensive suite of mobility, delivery, and financial services, Grab’s application faced mounting technical challenges as new features were continually integrated. Prior to these performance overhauls, the superapp suffered from cold start delays and notable spikes in ANR rates immediately following new weekly software releases. These post-release stability hiccups were primarily driven by the heavy overhead of reading numerous DEX files during the initial launch phase of the application. Read Also: Google Expands One-Handed Gesture Framework to Wear OS 7 Developer Community Google Play Expands Developer Tools, Discovery Features, and Quality Programs to Boost Engagement and Business Growth Although Google Play’s Cloud Profiles offered baseline optimizations for standard user flows across the general user base, they fell short of covering all the specialized initialization paths required for Grab’s critical user journeys. Essential operations, such as initializing Dagger dependency graphs during app launch, were left unoptimized in initial distributions. Consequently, devices had to rely on Just-In-Time (JIT) compilation and local background optimization over the course of several days following an update. To bridge this gap, Grab implemented custom Baseline Profiles, directly feeding critical user journey data into Google Play’s Cloud Profiles and ensuring that key application paths were compiled directly into machine code the moment the app was installed. The initiative unfolded across distinct strategic phases, beginning with the enablement of R8 optimization in compatibility mode. Transitioning away from legacy default Proguard files, the engineering team adopted proguard-android-optimize.txt. Given the age and sheer scale of the codebase, navigating legacy configurations and widespread reflection usage required careful planning. Coupled with Baseline and Startup Profiles, this initial phase yielded an immediate 25% reduction in user-perceived ANRs, a 16% drop in download size, and a 27% improvement in cold start times, effectively eliminating the post-release ANR spikes that had previously troubled development cycles. Building on this momentum, the team advanced to R8 Full Mode approximately nine months later. While standard libraries like Retrofit, Firebase, and Jetpack Compose integrated smoothly using built-in rules, migrating the remainder of the massive codebase required addressing complex reflection-heavy code paths. The engineering team adopted consumer keep rules from recent Gson releases to guarantee seamless JSON parsing and tackled optimization hurdles associated with Java dynamic proxies. Because runtime reflection usage in dynamic proxies cannot be easily detected during compilation, improper optimization can lead to stripped classes and application crashes. By isolating specific classes relying on reflection and applying targeted keep rules rather than broad exceptions, Grab preserved both application stability and optimization efficiency. The transition to R8 Full Mode delivered compounding structural benefits, generating an additional 14% reduction in app download size, a 10% improvement in startup time, and a further 10% decrease in user-perceived ANRs. To secure these hard-won gains for the long term, the engineering team focused heavily on keep-rule refinement and continuous code health governance. By integrating the R8 Configuration Analyzer into their evaluation workflow, the team gained deep visibility into how effectively their keep rules allowed the compiler to shrink, optimize, and obfuscate the application. This systematic approach to rule hygiene yielded an additional 3.6% reduction in app download size while providing the empirical data necessary to establish automated pre-merge CI guardrails. These guardrails ensure that newly introduced code complies with rigorous keep-rule standards, protecting performance metrics against future regressions across ongoing release cycles. Furthermore, tracking optimization scores over time has transformed how the organization approaches codebase maintenance. Beyond immediate runtime performance metrics, the adoption of the R8 optimizer introduced a permanent structural advantage for Grab’s massive codebase. Utilizing the open-source tool app-sizer, the engineering team observed that R8 permanently altered the resource cost of every line of code in the application, lowering the download size contribution per line. In an era increasingly shaped by AI-assisted development—where code volume can expand at unprecedented rates—this architectural defense against code bloat is vital. Without active optimization, code expansion proportionally inflates download sizes; with R8 enabled, the application maintains a drastically reduced memory footprint even as feature sets grow. Reflecting on the overarching technical journey, the engineering team noted that proactive performance management has fundamentally altered how features are delivered to the market. By addressing the root causes of startup latency and resource bloat through modern compiler tools and profiling mechanisms, Grab has secured a faster, more resilient application experience for millions of users across Southeast Asia, ensuring that future feature development can proceed without compromising application performance. Post navigation How Grab Overhauled Its Decade-Old Superapp Architecture to Slash App Size and Eliminate ANRs A more reliable way to add and edit contacts on Android | Android Developers’ Blog