Grab Mar 15, 2026

Enabling R8 optimization at scale with AI-assisted debugging

M7 Related OWASP risk: Insufficient Binary Protections Learn more →

Article Summary

Grab's Android team cracked a 6-year problem that stumped multiple attempts: enabling R8 optimization across 9 million lines of code. One engineer led the charge, and AI was the secret weapon.

Grab's superapp was drowning in ANRs (Application Not Responding errors) across all features, pointing to platform-level issues. R8 optimization was the known solution, but previous attempts failed due to debugging complexity, impossible testing requirements, and 2-hour build cycles. This time, they built custom AI tooling to break through.

Key Takeaways

Critical Insight

One engineer used AI-assisted debugging and pragmatic testing to enable R8 optimization across Grab's 9M+ line Android codebase, delivering major performance wins that eluded teams for 6 years.

The article reveals exactly how their MCP server orchestrates APK analysis and why their 'ripple effect' testing strategy worked when comprehensive testing was physically impossible.

About This Article

Problem

Grab's 9M+ line Android codebase was hitting high ANR rates across all features. Memory pressure, ad-heavy flows, and a mix of Compose and XML layouts made things worse. R8 optimization was blocked because obfuscated code required hours of manual reverse engineering work for each issue.

Solution

Grab built custom MCP tools that automatically decompile APKs and deobfuscate stack traces. They integrated AI with GitLab CLI to create parallel merge requests, testing multiple solution approaches at the same time. This removed the manual reverse engineering bottleneck entirely.

Impact

Tasks that used to take hours, like decompilation and deobfuscation, now take minutes. Parallel CI builds test multiple fixes at once instead of one after another. The entire R8 optimization rollout finished in 10 weeks with just one production issue.