Skip to main content
All posts
$less posts/gradle-build-time-optimization.txt
posts/gradle-build-time-optimization.txt0 min

Cutting Gradle Build Times in Half

author Nikita Pochaevdate Nov 2025category Tooling

Slow builds kill productivity. Here’s what actually worked for us when we needed to cut our 15-minute clean build down to something reasonable.

Configuration cache

The Gradle configuration cache is the single biggest win. It caches the result of the configuration phase, so subsequent builds skip all that plugin initialization and dependency resolution.

Enable it in gradle.properties. Fix the incompatible plugins. It’s worth it.

Build cache

Remote build cache means your CI builds warm the cache for everyone. A developer pulling main gets cache hits for all the modules they didn’t change.

Modularization done right

Don’t modularize for modularization’s sake. Modularize along build boundaries — modules that change independently should be separate. This maximizes cache hits and enables parallel compilation.

Results

  • Clean build: 15 min → 8 min (modularization + parallel)
  • Incremental build: 4 min → 45 sec (configuration cache)
  • CI build: 12 min → 4 min (remote cache)

The investment was about two weeks of focused work. The payoff is every single day.

#Android#Tooling
up 47d 6h 23mload 1.47 1.22 0.98tasks 406thr 1,247mem 37%
interactive shell -- try: help, ls posts/, cat meridian, open blog, neofetch
po4yka@ghostty:~$

© Nikita Pochaev · built with ghostty vibes