7 min read
|
Saved February 14, 2026
|
Copied!
Do you care about this?
This article outlines a case study on troubleshooting performance problems in a large TypeScript monorepo. It details steps taken to diagnose issues, including checking source file inclusion, measuring performance metrics, and using compiler tracing to identify bottlenecks.
If you do, here's more
The article outlines a case study addressing performance issues in a large TypeScript monorepo with seven packages. Developers faced sluggish intellisense and long type-checking times, which hindered productivity. The project employed project references and incremental compilation but included heavy dependencies like Prisma, Kysely, and Hotscript, which likely contributed to the performance problems.
Troubleshooting began with standard checks, such as ensuring the editor and TypeScript version were up to date and examining resource usage. The author emphasized validating source file inclusion to minimize the workload on the compiler. Using commands like `tsc --listFilesOnly` and `tsc --explainFiles`, they identified unnecessary files in the compilation, which could be excluded by tweaking the TypeScript configuration.
To gather performance metrics, the `tsc --extendedDiagnostics` command provided insights into memory usage and time spent in various compilation phases. The article highlights that if the compiler is slow in parsing, binding, or type-checking, it can be beneficial to generate compiler traces using `tsc --generateTrace`. Analyzing these traces helped pinpoint problematic code. In this case, a specific file took an excessive amount of time during type-checking, signaling a need for further optimization.
Questions about this article
No questions yet.