Dotty Linker: Precise Types Bring Performance
summary
Dotty Linker is a whole‑program optimizer that analyzes application and library call graphs, generates only the specializations actually used and eliminates boxing and megamorphic dispatch, turning generic-heavy Scala code into near-native code; a simple reduce example shows Scala collections can be ~20× slower without this. It avoids the 10^n code explosion around 10 primitive types by per-program specialization, exposes rewrite rules like turning length==0 into isEmpty, and works as a prototype with faster runtime but some compile‑time and HotSpot limitations.
AI-written summary · about
chapters (20)
- 0:00Who am I
- 1:27Where does slow down come from
- 2:17Scala vs Java
- 3:53Dynamic Dispatch
- 5:47Compiler
- 8:46Specialization
- 12:03Specializations
- 14:43Use Cases
- 16:12Demo Benchmark
- 18:22Limitations
- 21:17Less code
- 22:18Complex code
- 23:36Library optimizations
- 24:09Rewrite rules
- 26:10Purity
- 28:01Warnings
- 29:37Logging
- 36:00Randomized Testing
- 36:57Current Status
- 41:10Thank You
related talks
50mIs scala code slow?
42mFaster Scala Collections with Scalaxy/Streams!
23mPattern-Based Optimization (...)
40mA Tale of Types, Classes, and Maps
55mCode Size Compiler Optimizations and Techniques for Embedded Systems
42mPractical Optimizations
01h 37mAn Overview of Program Optimization Techniques
10mTypes, TypeScript and the JIT
