Big if True: Microsoft recently teased some truly impressive performance improvements coming to TypeScript. The lead architect of the open-source programming language wants TS to deliver an excellent developer experience, even with the most demanding and massive codebases.
TypeScript should soon become 10x faster on average. Anders Hejlsberg’s team at Microsoft is working on a radical improvement to its performance with a new native port of the language’s compiler and tools. The Microsoft code designers will bring TypeScript to Go, porting the project’s most current codebase while keeping the older versions for compatibility’s sake.
According to the latest TIOBE Index, TypeScript is currently the 37th most popular language in the world, while Go(lang) is seventh. Hejlsberg stated that the new implementation would drastically improve editor startup times, reduce most compilation times by a factor of 10, and substantially decrease memory usage.
While Go is a properly compiled high-level language, TypeScript is designed to develop large applications and transpile (trans-compile) them to JavaScript. However, it can become a real thorn in the side with truly massive codebases. Hejlsberg stated the obvious when saying that TS isn’t the fastest language. Although it can laughably run Doom at 0.0000009645 fps.
Programmers must endure long load and check times in their preferred code editors with the current version of TypeScript. For some projects, developers must choose between loading their codebase in a reasonable time or getting a complete view of the source code. Hejlsberg cited the obligatory “new experiences powered by AI benefit,” exploiting large semantic datasets, which need to be available within shorter latency times.
The new Go version of TypeScript, which users can build and run from a new working repository, can already speed up loading times in many popular codebases on GitHub. Hejlsberg provided some interesting examples, with performance improvements ranging from 9.1x (tRPC) to 13.5x (TypeORM) through the current TS Go implementation.
“While we’re not yet feature-complete, these numbers are representative of the order of magnitude performance improvement you’ll see checking most codebases,” the lead developer said.
Performance is most important in code editors, as developers spend most of their time there. Using the Visual Studio Code codebase as a benchmark, Hejlsberg said that loading the entire project on a fast computer goes from around 9.6 seconds to around 1.2 seconds.
Overall memory usage “appears” to be cut in half compared to the current implementation, even though further optimizations and improvements could be possible. The most recent version of TypeScript is 5.8, while Microsoft will release TS 5.9 soon. Hejlsberg confirmed that the current, JavaScript-based implementation of the language will continue into the 6.x series, while the new Go version is designated TypeScript 7.0. Microsoft plans to support both TS 6.x and 7.x until the newer iteration is mature enough.