Porting the TypeScript Compiler to Go for a 10x Speedup V2
summary
Ports 150,000+ lines of TypeScript and 90,000 tests into Go, using a TS-to-Go tool to convert code, a node arena pool to cut allocations (parsing shows ~96% fewer allocations and a 20% boost), and multiple concurrent checkers so parsing is 3–4x faster single-threaded and over 10x with all cores. VS Code compile drops from ~80s to ~7s in early runs; Slack build goes from ~6min to ~40s and Figma sees ~5x speedup. Race detector and an immutable snapshot model eliminate concurrency bugs.
AI-written summary · about
chapters (20)
- 0:00Introduction to TypeScript
- 1:04TypeScript's Scale and Impact
- 2:29Challenges of JavaScript
- 4:46The Need for a New Compiler
- 7:24Language Choice and Requirements
- 8:55Porting Process and Tools
- 11:50Initial Results and Team Growth
- 13:24Community Reaction
- 14:56Testing Infrastructure
- 16:53Data Structures in Go
- 20:59Performance Optimization Techniques
- 22:38Handling String Encoding
- 24:13Compiler Concurrency Design
- 27:48Addressing Concurrency Bugs
- 29:24Language Server Improvements
- 31:26Go-Specific Challenges
- 33:16Performance Gotchas and Fixes
- 35:50Features Left Behind
- 36:30Current Status and Impact
- 37:40Future Work and Conclusion
related talks
32mTypeScript’s 10x Native Port
35mTypeScript at Google
28mTypescript Performance: Going Beyond The Surface
28mThe Secret To Fast TypeScript
36mNavigating TypeScript Performance for Better Dev Experience
38mPorting 100K lines of code to TypeScript
49mTypescript. Runtime. And in Between.
24mTypeScript and how I've learned to love the compiler
