Gradle under a microscope profiling and optimizing builds
summary
Gradle build time splits into configuration and execution; Android X runs ~16,500 builds and ~9,500 pre-submits monthly so saving seconds multiplies. Concrete fixes: enable parallel builds and a remote build cache (S3/GCS), adopt configuration cache (Gradle 8.0.1) and benchmark with Gradle Profiler + YourKit. Findings: configuration cache serialization can cost ~40s, Square cut weekly build hours from ~184 to ~24, external Git calls and 287,000 thrown exceptions cost ~10s, unbuffered IO and reflection add seconds; buffering and reducing repeated work fix it.
AI-written summary · about
chapters (9)
- 0:00Welcome and introduction
- 1:11What is Gradle and why it matters
- 3:58Optimizing execution phase
- 8:48Configuration phase deep dive
- 15:29Single-threaded bottlenecks
- 23:32Gradle Profiler for profiling
- 29:05Real-world optimization examples
- 36:50Avoiding regressions and future work
- 38:13Q&A
related talks
28mMaking the most of your Gradle Builds
44mGradle: The Build System That Loves To Hate You
45mGradle Build: Measuring What Matters Most
44mA Healthy Dose of Gradle
36mImproving Gradle Builds
35mGradle recipes for reducing your build times
02h 49mGradle: Give Your Build Some Love and It Will Love You Back!
48mGradle 3.0 and beyond for Android Development
