Accelerate Your Android Development: Essential Tips to Minimize Gradle Build Time (Part II of II)
Article Summary
Rolgalan from Glovo's Mobile Platform team reveals how they slashed Android build times through hardware and JVM tuning. Most teams are leaving massive performance gains on the table by ignoring these fundamentals.
This is Part II of a deep dive into Gradle build optimization, focusing on hardware configuration, JVM memory settings, and lesser-known tweaks. Glovo's team shares battle-tested strategies from optimizing builds for both CI/CD pipelines and local development across their mobile apps.
Key Takeaways
- Switching from Fargate to EC2 with wrong disk caused 3x slower cache reuse
- Default 512MB heap is too small: tune Xmx, Xms, and separate Kotlin daemon memory
- Test workers spawn per core: 16 cores can consume 16GB RAM simultaneously
- Dagger finally supports KSP over KAPT for dramatically faster annotation processing
- Different garbage collectors showed 35min vs 60min+ builds on identical hardware
Critical Insight
Hardware specs (especially NVMe disks and core count) and JVM memory configuration are the most impactful optimizations after implementing caching and parallelization.