JavaScript as a compilation target - Making it fast
summary
The Dart-to-JavaScript compiler dart2js compiles closures to classes, replaces operators with static interceptors, and runs local SSA-based optimizations plus function inlining and loop hoisting; it does speculative optimizations with bailouts to get speed while trading code size. Benchmarks hit about 75–78% of handwritten V8 performance, static interceptor code can be 6× (sometimes 23×) slower before optimization, and speculative guards increase output size by ~15–72%; tree-shaking and a Dart-aware minifier shrink unused code.
AI-written summary · about
chapters (6)
- 0:00Start
- 2:32Example: What's the point?
- 9:42Interceptors
- 11:45Example: Sum the elements of a list Compiled JavaScript code with local type inference
- 21:07Code size
- 22:00Performance








