How We Cut the Build Time for Our Android App by 95%
Article Summary
Zomato's Android team was losing 7 hours of productivity every single day just waiting for builds. A 10-person team, 20 builds per day, 2+ minutes each time. The math was brutal.
The Zomato engineering team tackled their massive Android app build times (29 modules, 1.2M lines of code). They used Gradle profiling and build scans to diagnose bottlenecks, then systematically eliminated wasted work.
Key Takeaways
- Build time dropped from 2 minutes 18 seconds to just 7 seconds
- Fixed dependency graph using implementation vs api to enable parallel builds
- Removed Firebase Perf and NewRelic plugins from debug builds (saved 40 seconds)
- Eliminated changing BuildConfig variables that invalidated incremental compilation
- Android Instant Run now works, dramatically improving UI iteration speed
Zomato cut Android build times by 95% (from 138 seconds to 7 seconds) by fixing their module dependencies, removing debug build overhead, and enabling incremental compilation.
About This Article
Zomato's Android app had 29 submodules, 6,400 Java files, 1,300 Kotlin files, and over 17,000 XML files. The dependency graph was tangled, which blocked parallel compilation and forced tasks to run one after another across 12 available threads.
The team ran gradle assembleDebug --scan and found the dependency graph was poorly structured. They replaced api dependencies with implementation dependencies to cut unnecessary recompilation chains. This let Gradle process tasks in parallel.
With the dependency graph fixed, the build system used all 12 threads effectively. Incremental builds for UI-only changes now take 7 seconds instead of 138 seconds. That's a 95% faster build time.