DEV Community

loading...

Discussion on: TypeScript is slow. What can we do about it?

Collapse
elmuerte profile image
Michiel Hendriks

Isn't the real problem TS's language server? Why does it need to visit so many files every time. Can't it just keep around the "compiled" results? It doesn't need to rebuild the whole AST for the file you are editing... right? Or is this a limitation of the language server protocol design?

Collapse
alekseiberezkin profile image
Aleksei Berezkin Author

These are very good questions! The server could have cached something but this, I suppose, would only trade problems: if there's caching, chances are the editor and the server may get out of sync. Invalidating caches is always a hard problem.

Collapse
elmuerte profile image
Michiel Hendriks

Sure, but the IDE should obviously communicate changed regions. This how IDEs work internally with languages they support as first class citizens.

Thread Thread
alekseiberezkin profile image
Aleksei Berezkin Author

I'm not sure TS supports this. Do you have some insights?