Blog Logo
TAGS

A 10x Faster TypeScript - TypeScript

Today I’m excited to announce the next steps we’re taking to radically improve TypeScript performance. The core value proposition of TypeScript is an excellent developer experience. As your codebase grows, so does the value of TypeScript itself, but in many cases TypeScript has not been able to scale up to the very largest codebases. Developers working in large projects can experience long load and check times, and have to choose between reasonable editor startup time or getting a complete view of their source code. We know developers love when they can rename variables with confidence, find all references to a particular function, easily navigate their codebase, and do all of those things without delay. New experiences powered by AI benefit from large windows of semantic information that need to be available with tighter latency constraints. We also want fast command-line builds to validate that your entire codebase is in good shape. To meet those goals, we’ve begun work on a native port of the TypeScript compiler and tools. The native implementation will drastically improve editor startup, reduce most build times by 10x, and substantially reduce memory usage. By porting the current codebase, we expect to be able to preview a native implementation of tsc capable of command-line typechecking by mid-2025, with a feature-complete solution for project builds and a language service by the end of the year. Our native implementation is already capable of loading many popular TypeScript projects, including the TypeScript compiler itself. Here are times to run tsc on some popular codebases on GitHub of varying sizes: VS Code - Size (LOC) 1,505,000, Current 77.8s, Native 7.5s, Speedup 10.4x. Playwright - Size (LOC) 356,000, Current 11.1s, Native 1.1s, Speedup 10.1x. TypeORM - Size (LOC) 270,000, Current 17.5s, Native 1.3s, Speedup 13.5x. date-fns - Size (LOC) 104,000, Current 6.5s, Native 0.7s, Speedup 9.5x. tRPC (server + client) - Size (LOC) 18,000, Current 5.5s, Native 0.6s, Speedup 9.5x.