How Incremental Compilation Makes Scala 3 Builds Faster
summary
Scala 3 keeps Zinc’s incremental algorithm and adds name hashing plus API and dependency phases inside the compiler so builds detect changes fast; collecting APIs and dependencies costs about 10% overhead but a one-line edit drops a 15s cold build to under 1s. Pickler emits TASTy signatures early so downstream modules can start compiling, enabling pipelining that yields ~20–34% faster builds at the cost of higher memory and some concurrency risk. Two‑pass/outline compilation promises further speedups.
AI-written summary · about
chapters (20)
- 0:00Introduction to incremental compilation
- 1:04About the Scala Center
- 2:07Why incremental compilation matters
- 3:14Compilation pipeline overview
- 5:40What is incremental compilation
- 7:45Rules for efficient incremental compilation
- 8:27How Zinc tracks changes
- 11:19Scala 3 compiler phases
- 12:45Dependencies and API tracking
- 15:00Name hashing explained
- 17:09Optimizing code structure
- 18:12Scala 3 changes for Zinc
- 20:22Multi-project builds
- 23:37Pipeline builds concept
- 25:44Demo of pipeline builds
- 29:41How pipelining speeds up builds
- 31:28Benchmarking pipeline builds
- 33:38Two-pass compilation idea
- 35:24Summary and future work
- 36:15Q&A session
