Skip to content
ai news

TypeScript Just Got 10x Faster

Millions of developers are about to get hours of their week back, but it's not because of AI. The secret lies in a fundamental shift under the hood that finally fixes JavaScript's biggest bottleneck.

Jonah Park
TypeScript Just Got 10x Faster

The Bottleneck We All Ignored

TypeScript 7 has achieved significant performance gains, prominently demonstrated by its new compiler's ability to build the VS Code codebase. This massive project, encompassing 1.3 million lines of code across nearly 8,000 files, now compiles in just 10 seconds. This represents a dramatic reduction from the 125 seconds required by the previous compiler, marking an 11.9x speed improvement for one of the most widely used development environments.

Microsoft Technical Fellow Anders Hejlsberg precisely identified the core problem: JavaScript's design optimizes for user interfaces and web browsers, not the compute-intensive workflows essential for compilers. Its fundamental single-threaded architecture severely limits scalability, preventing efficient utilization of modern multi-core processors for critical operations like processing abstract syntax trees or performing comprehensive type checking.

While JavaScript offers Web Workers as a concurrency mechanism, they prove unfeasible for compiler operations. Distributing intricate data structures, such as parsed syntax trees, to separate worker threads demands immense serialization and deserialization overhead. This process of converting complex objects into raw bytes and back often consumes more computational resources and time than the actual work, making Workers an impractical solution for the shared-memory, high-throughput requirements of a compiler.

Why Go Was the Perfect Weapon

The TypeScript compiler's rewrite in Go delivered the substantial performance increases. This strategic porting addressed JavaScript's inherent limitations for compute-intensive tasks. Approximately half of the observed speedup stems from running natively compiled code, with the remaining half attributed to Go's highly efficient, shared-memory concurrency model.

Go effortlessly distributes computational work across all available CPU cores. This contrasts sharply with JavaScript, which remains largely confined to a single core for CPU-bound operations. Modern processors increasingly feature more cores rather than faster individual cores, amplifying Go's ability to fully utilize hardware resources for parallel processing.

Go's concurrency model simplifies the distribution of CPU-bound tasks. It removes the need for developers to manage complex threads or serialize and copy data between processes, a common bottleneck in JavaScript when attempting to use web workers. This design makes Go inherently superior for compiler operations, allowing direct object sharing and streamlined parallel execution.

Instant Feedback, Finally

Performance gains extend beyond compiler execution, profoundly impacting the daily developer experience through the TypeScript language server. Prior versions frequently subjected developers to noticeable delays, waiting for crucial type-checking results and error highlighting to manifest in their IDEs, particularly within extensive codebases. This often created frustrating pauses in workflow.

TypeScript 7 fundamentally alters this dynamic, delivering near-instantaneous feedback. Developers now observe precise type-checking outcomes and the familiar 'squiggly lines' indicating errors in mere milliseconds. This responsiveness holds true even when modifying large-scale projects, effectively eliminating the painful waits that previously hindered continuous development and productivity.

Crucially, the new language server also boasts significant stability improvements. Metrics reveal a dramatic reduction in operational failures: failing language server commands have decreased by over 80% compared to TypeScript 6. Furthermore, server crashes, a common source of interruption, saw a substantial reduction of more than 60%.

These combined enhancements minimize the need for manual restarts and troubleshoot persistent tooling issues. For a comprehensive overview of these improvements and other new features, refer to the official Announcing TypeScript 7.0 - Microsoft Developer Blogs. The Go port has undeniably transformed the responsiveness and reliability of the TypeScript development environment.

Enjoying this? Get one like it in your inbox each morning.

one email a day · unsubscribe in two clicks · no third-party tracking

How to Upgrade (And What to Watch For)

Users upgrading to the new compiler can execute npm install typescript to acquire version 7. For VS Code users, installing the specific 'TypeScript 7' extension is also necessary to fully leverage the performance improvements within the IDE. This release represents a direct port of the existing compiler to Go, not a ground-up rewrite.

This approach ensures broad compatibility with existing codebases. Developers should expect the primary noticeable change to be a dramatic increase in compilation speed and enhanced responsiveness from the language server. Functional behavior remains largely consistent with previous TypeScript versions.

A critical limitation in this initial release is the absence of a fully compatible programmatic API. This omission directly impacts several key tools within the TypeScript ecosystem. Projects relying on these utilities for tasks like linting, testing, or runtime execution will not function correctly with TypeScript 7.0.

Specifically, integrations such as:

  • typescript-eslint
  • ts-jest
  • ts-node

These and other similar tools await an update. Developers should note that full compatibility for the programmatic API is anticipated with the upcoming TypeScript 7.1 release, which will address these ecosystem dependencies.

Frequently Asked Questions

Why was the TypeScript compiler rewritten in Go?

The original JavaScript-based compiler was limited by JavaScript's single-threaded nature, which is ill-suited for compute-intensive tasks. Go was chosen for its native performance and superior shared-memory concurrency, allowing the compiler to use all available CPU cores.

How much faster is TypeScript 7?

It's dramatically faster. For example, it compiles the 1.3 million-line VS Code codebase in about 10 seconds, compared to 125 seconds for the old compiler—an almost 12x improvement. Similar gains are seen across other large projects.

Will TypeScript 7 break my existing tools?

Potentially. While the compiler is designed to be compatible, the programmatic API is not yet available. Tools that depend on it, like typescript-eslint, ts-jest, and ts-node, will not work until the 7.1 release.

How can I start using TypeScript 7?

You can install it via npm (npm install typescript). For the best experience in VS Code, you must also install the specific 'TypeScript 7' extension from the marketplace, as the default is not yet updated.

Found this useful? Share it.

For builders

Want Stork to write one of these about your product?

Send us a URL. We use the product, form a view, and publish what we actually think — in 8 languages, labeled Sponsored, with no copy approval on your side. That last part is what makes it worth quoting.

See how it works$500 · AI tools & software only