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
- Achieved 26% reduction in app download size over six months
- Built custom App Sizer tool integrated with CI and Grafana for daily analytics
- Removed transitive R classes by upgrading AGP to 4.1.1
- Converted all PNG images to WebP format for size savings
- Identified one library contributing 8% of total app size and removed it
Grab reduced their Android app download size by 26% through systematic measurement, aggressive R8 optimization, and resource cleanup across 1,500+ modules.
About This Article
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.
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.
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.