Grab Aug 12, 2021

Project Bonsai

Article Summary

Grab's Android app had 4 million lines of code and was bleeding users. Google's research showed every 6MB increase costs 1% of conversions.

Grab's engineering team launched Project Bonsai in 2021 to tackle app bloat that was hurting user acquisition across Southeast Asia's low-end devices and limited bandwidth. This deep dive covers their systematic approach to measurement, reduction, and containment.

Key Takeaways

Critical Insight

Grab reduced their Android app download size by 26% through systematic measurement, aggressive R8 optimization, and resource cleanup across 1,500+ modules.

The team is now experimenting with treating app size as a limited resource with per-team budgets, a fascinating approach to long-term containment.

About This Article

Problem

Grab's 1,500+ modules and hundreds of third-party libraries created massive transitive R classes with millions of lines of code. This caused unexpected app size increases that had nothing to do with new features.

Solution

Grab built a custom App Sizer analytics tool and connected it to CI and Grafana to track which teams and modules were driving size growth. They then removed unused R class fields by upgrading to Android Gradle Plugin 4.1.1 and reviewing R8 keep rules.

Impact

During the Containment phase, Grab launched an App Growth Rate dashboard to watch how app size changed between releases. The team plans to give individual teams their own app size budgets so the superapp can keep growing without bloating.