Project Butter: A Journey for App Performance Improvement
Article Summary
Gojek's Android app was taking 14.35 seconds to launch. With 500+ modules and millions of lines of code, something had to change.
In 2021, Gojek's mobile platform team launched Project Butter to tackle severe performance issues across their consumer app. Senior Principal Engineer Raditya Gumay shares the technical journey of optimizing app launch, size, and responsiveness at massive scale.
Key Takeaways
- Reduced dex files and enabled Dagger FastInit for compile-time wins
- Three-tier architecture shifted from O(N) sequential to O(1) parallel initialization
- Replaced ServiceLoader with casting, eliminating 2 seconds of overhead
- Lazy Dagger component initialization prevented zombie objects in memory
- Monitor contention fixes removed 30ms+ blocking delays on main thread
App launch time dropped from 14.35 seconds to 6.2 seconds through compile-time optimization, architectural refactoring, and eliminating blocking operations.
About This Article
Gojek's Android codebase had over 500 modules, which caused Android Studio to freeze frequently. The dependency initialization patterns were complex and prevented parallel execution during app startup.
Raditya Gumay's team refactored the Dagger dependency graph to initialize product components lazily. Instead of loading everything at Application#onCreate, they deferred non-critical dependencies until features actually needed them.
Lazy Dagger initialization cut down on unnecessary memory allocations and zombie objects during app launch. This reduced peak memory pressure, improved system stability, and helped reduce launch time by 8.15 seconds.