How we brought down our build times. Modularization impact on build speeds and metrics
summary
Pinterest modularization increases parallel compilation but P95 builds jump from ~9m to 14m due to thermal throttling and unnecessary recompiles; experiments with 1/8/16 threads show little gain after a point and heavy parallelism worsens durations. Using Gradle Enterprise and build scans identifies causes: base module lines double and compile time triples, 52 of top‑100 edited files live near the dependency bottom, nondeterministic generated files and jettifier churn, and rapid eviction of the remote build cache. Results: P50 → 26s (60% faster), P95 → 6m28s (70% faster).
AI-written summary · about
chapters (23)
- 0:00Introduction and agenda
- 1:57About Pinterest and our mission
- 3:01Build times before and after
- 5:11Areas of investigation
- 7:20Gradle Enterprise overview
- 7:41Modularization expectations and reality
- 10:33Thermal throttling impact
- 13:04Parallelization limits and learnings
- 13:25Frequently modified files analysis
- 15:49Dependency graph impact on builds
- 17:13Common build scenarios
- 20:24Cache reuse challenges
- 23:12Remote cache eviction issues
- 25:41Importance of build metrics
- 26:03Base module recompilation metric
- 27:06Non-cache compilation time metric
- 28:10Cache regression tracking
- 28:52Remote cache artifact eviction metric
- 30:20Gradle profile runs for regressions
- 32:07M1 laptop distribution impact
- 32:49Results and improvements achieved
- 33:31Next steps and future plans
- 34:12Q&A session
related talks
30mHow we brought down our build times. General optimization tips
40mNail your Gradle build time
40mSimple Recipes to Enhance Developer Productivity
27mFaster builds on Android: from 2 minutes to 2 seconds
33mImprove the build times of your project
36mImproving Gradle Builds
40mCode metrics for your app
46mDeveloper Productivity at Scale
