Get the latest tech news
An approach to optimizing TypeScript type checking performance
A process for measuring and optimizing TypeScript type checking performance
The type checker operates within the TypeScript compiler during build time and the language server in your editor while editing, making it challenging to apply conventional debugging approaches. We recently faced a similar challenge when TypeScript 5.3 introduced changes to the type inference algorithm, resulting in a significant performance regression. As you can see, having benchmarks that track the number of type instantiations for a given expression allows us to quantify our experiments, turning wild guesses on what might be faster into concrete measurements.
Or read this on Hacker News