GrabNguyen Van MinhProblem & solution
Enabling R8 optimization at scale with AI-assisted debugging
Summary
Grab enabled R8 optimization for its Android app after repeated attempts were blocked by debugging difficulty, organization-wide testing demands, and slow build feedback. The effort targeted a roughly 10-year-old codebase exceeding 9 million lines and combined AI-assisted debugging, a pragmatic testing strategy, and infrastructure investment. Its QA build was configured to match production R8 processing. Beyond existing shrinking, optimization added techniques such as method inlining, class merging, constant folding, dead-code elimination, and devirtualization. After about 10 weeks with one engineer coordinating across teams, the project reported around 25% lower ANR rates, a 16% reduction in reference-device download size, and nearly 27% faster startup; the startup result combined R8 with corrected Baseline and Startup Profiles.
Context
Since 2024, Grab observed rising Application Not Responding rates across the app, with correlations to memory pressure, ad-heavy flows, and complex layouts combining Jetpack Compose and XML. Previous R8 optimization attempts over six years had encountered debugging, testing, and feedback-loop challenges in a codebase exceeding 9 million lines and maintained by more than 100 engineers.
Approach / What changed
Grab combined AI-assisted debugging, a pragmatic testing strategy, and infrastructure investment to enable R8 optimization at scale. The implementation included a QA build whose R8 configuration matched production processing, enabling validation of optimization-specific issues before rollout.
Takeaways
R8 optimization delivered around a 25% reduction in ANR rates, a 16% decrease in zipped APK download size on a reference device, and nearly 27% faster startup.
The reported startup improvement combined R8 optimization with a corrected implementation of Baseline and Startup Profiles; R8 alone initially produced about a 12% improvement.
The project took about 10 weeks and was led by one engineer working with multiple teams, after earlier attempts had been hindered by slow investigation, impractical full regression testing, and builds taking up to two hours.
Source and freshness
- Source
- engineering.grab.com
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.