Glovo Rolgalan

Glovo's Essential Tips to Minimize Gradle Build Time (Part II of II)

Original post Accelerate Your Android Development: Essential Tips to Minimize Gradle Build Time (Part II of II)

M2 Related OWASP risk: Inadequate Supply Chain Security Learn more →

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

Critical Insight

Hardware specs (especially NVMe disks and core count) and JVM memory configuration are the most impactful optimizations after implementing caching and parallelization.

Continue reading

What This Article Covers

Problem

Glovo's engineers dealt with unpredictable build delays of several minutes. Dependencies needed to download during builds, and network variability made build times inconsistent between local machines and CI environments.

Solution

The team pre-cached dependencies, Gradle, Android SDK tools, and Robolectric system images on CI agents. They used GitHub Actions' gradle-build-action, which automatically caches compiled build scripts and the ~/.gradle folder.

Impact

With downloads eliminated and cached build artifacts in place, build times became consistent and reproducible. The multi-minute network overhead that slowed incremental builds disappeared.

The article includes a surprising discovery about when G1 garbage collector outperforms ParallelGC, contradicting Android's official recommendations.

This page summarizes “Accelerate Your Android Development: Essential Tips to Minimize Gradle Build Time (Part II of II)” by Glovo, published Nov 6, 2023. All credit for the original work goes to the authors.

Read the original on medium.com (opens in new tab)

AI tools for Android

Browse all AI tools →