Gradle: Incremental compilation 101
summary
Research into incremental compilation for the Android toolchain compares concrete behaviors: Java’s class-based heuristic in Gradle recompiles changed classes plus any class that references them, so in a 250-class synthetic test ABI-compatible and incompatible edits show little top-level difference, while extracting an interface reduces rebuild scope; Gradle 6.0 narrows blast radius and Gradle 7.1 fixes public-constant explosions. Kotlin’s compiler uses symbol-based analysis, online inlining still forces callers to recompile, and enabling useClassSnapshot (Kotlin 1.6.20+; public in 1.7.20) yields about 12% raw build-time savings in profiled runs with Gradle Profiler.
AI-written summary · about
chapters (11)
- 0:00Start
- 15:06Java IC: Synthetic Test
- 15:37Android Studio poet
- 18:28Java IC: Constants
- 26:10Levels of Incrementality
- 30:05Kotlin CA: Old Approach
- 35:19Kotlin CA: Synthetic Test
- 38:22What Did We Not Discuss?
- 39:57How to Develop Your Project?
- 44:19Parallel Build
- 45:15Parallel Kotlin Compilation?
related talks
48mGradle 3.0 and beyond for Android Development
34mWhat's new in Android development tools
48mOptimizing Android Build Performance
21mWhat's new in Android Build
40mImproving Android Build Performance
40mMake The Android Gradle Plugin Work For You
40mBetter Android Development with Kotlin & Gradle
28mBest practices using compilers in Android Studio
