A practical guide to diagnosing and fixing TypeScript performance problems in large codebases. Covers using --extendedDiagnostics and --generateTrace to identify bottlenecks, then addresses the four most common expensive patterns: deeply nested generic inference, recursive conditional types, massive discriminated unions, and heavy as-const object literals. Also covers tsconfig settings that actually matter (skipLibCheck, incremental, isolatedModules), correct project references setup, editor/language server tuning, and what Project Corsa (Go-based compiler) will and won't fix. Includes a concrete step-by-step diagnostic loop.
Table of contents
The First Question: Where Is the Time GoingThe Patterns That Actually Cost YouProject References, the Right WayCompiler Settings That Matter for SpeedEditor Performance Is a Different ProblemWhat Project Corsa Changes, and What It Does NotA Concrete Diagnostic LoopWhat I Would Tell You If You AskedSort: