The headline is fast—but the fine print matters #
Rust’s independent TypeScript port completed tested runs in roughly 0.2–0.5 seconds, a significant improvement over Go’s 0.6–2.2 seconds and JavaScript’s 6.6–13 seconds. This translates to an average 2.5x to 3x speedup compared to Go, and up to 4.4x faster in scenarios with cascading errors.
Crucially, this performance boost comes from an independent Rust port, not Microsoft’s official compiler work. Back in July, Microsoft ported the TypeScript compiler to Go, delivering a ~10x speedup over the original JavaScript version. The Rust port, often leveraging AI agents, is a community-driven initiative built on top of the Go version, not a replacement by Microsoft.
This distinction is vital: the Rust compiler is an impressive, unofficial development. It demonstrates what’s possible when a codebase is re-engineered with a focus on performance, often with AI assistance.
An eye-catching speedup on a single, albeit large, repository like the TypeScript project itself is a strong signal. However, it is not definitive proof that every TypeScript project will automatically see the same dramatic gains. The central tension lies in whether these initial benchmarks generalize across diverse project types and complexities.
Four tests, one striking performance gap #
Performance testing used the official TypeScript repository from GitHub, comprising 793 files and approximately 380,000 lines of code. This robust testbed allowed for a comprehensive comparison across four distinct scenarios: - All types valid - Single simple type error - Broken core type with cascading errors - Deep recursive types
Results were stark. For valid types, JavaScript took around 7 seconds, Go 0.7 seconds, and Rust completed the task in just 0.3 seconds. When a core type was broken, triggering cascading errors, JavaScript recorded 13 seconds, Go 2.2 seconds, and Rust finished in a mere 0.5 seconds. These figures highlight a consistent and significant performance gap.
Overall, the video reported Go as roughly 9–10 times faster than JavaScript. Rust, in turn, delivered approximately 24 times the speed of JavaScript and nearly three times the speed of Go. While rounded timings and a single codebase limit absolute precision, the performance hierarchy is undeniable.
Microsoft's July port of TypeScript to Go offered substantial gains. However, the subsequent Rust implementation demonstrates an even greater leap, particularly in complex error-handling scenarios. The data clearly shows a new performance benchmark.
Why the Rust result deserves a closer look #
Compiler workloads represent a demanding test for any language, even Go or Rust. Type checking involves intricate recursive relationships, constructing large dependency graphs, and generating diagnostics that can multiply exponentially when a core type is broken. This complexity explains why the JavaScript compiler took up to 13 seconds in the "core type broken" scenario.
Rust’s performance advantage over Go, averaging 2.5x to 3x faster, likely stems from fundamental differences in memory management and runtime overhead. Rust's zero-cost abstractions, explicit memory layout, and lack of a garbage collector can minimize allocation behavior and reduce cache misses, providing a tangible edge in CPU-bound tasks like compilation.
The emergence of a Rust port for TypeScript, facilitated by AI-assisted development, highlights a significant trend. Large, existing codebases with extensive test suites, like the TypeScript repository on GitHub, offer ideal targets for iterative translation by coding agents. This approach can rapidly generate functional ports, as seen with projects like tsrs; for more on this, read Introducing tsrs: a Port of TypeScript to Rust.
However, passing existing tests does not automatically guarantee complete compatibility or identify subtle behavioral differences. While AI-driven porting is powerful, rigorous human-led validation remains crucial to ensure functional parity and maintain the integrity of the original implementation. The speed is undeniable, but the long-term stability requires careful scrutiny.
Enjoying this? Get one like it in your inbox each morning.
one email a day · unsubscribe in two clicks · no third-party tracking
A benchmark win is not a drop-in replacement #
A benchmark win is not a drop-in replacement. Before adopting a Rust port, developers must verify several critical factors. Crucially, assess language and compiler API parity with the official TypeScript implementation, ensuring seamless integration with existing editor tooling, build systems, and diagnostic output. Behavior on your own projects is the ultimate test.
Conduct a fair local trial, comparing identical compiler options across both the official and Rust versions. Include clean and incremental compilation runs, monitor memory use, and evaluate performance on representative CI workloads, not just a few timed executions. This comprehensive approach reveals true production readiness.
This Rust port’s impressive results, particularly its 3x speedup over Go, raise the bar for compiler performance. Such alternative implementations pressure the broader ecosystem to innovate, showcasing how optimized native code can dramatically improve developer experience. While the numbers are compelling, production readiness depends on trust and full compatibility.
Ignore this Rust port if your primary concern is immediate stability and full feature parity with the official Microsoft TypeScript compiler. Until comprehensive integration and ecosystem support mature, the benchmark-winning Rust version remains a compelling proof of concept, not a drop-in replacement for most production environments.
Frequently Asked Questions #
Is Microsoft’s TypeScript compiler now written in Rust?
No. The video compares an independent Rust port with the existing JavaScript compiler and Microsoft’s Go implementation.
How much faster was the Rust port in the video’s tests?
On the tested TypeScript repository, it averaged about three times faster than Go and about 24 times faster than JavaScript.
What did the benchmark test?
It measured four cases in the TypeScript repository: valid types, a simple type error, cascading core-type errors, and deeply recursive types.
Should teams replace their TypeScript compiler with the Rust port?
Not based on these results alone. Teams should verify compatibility, tooling support, and performance on their own projects before switching.