diff --git a/Performance.md b/Performance.md index 5c470464..7bf4dbe6 100644 --- a/Performance.md +++ b/Performance.md @@ -492,6 +492,15 @@ Isolated file emit can be leveraged by using the following tools: * [ts-jest](https://kulshekhar.github.io/ts-jest/) can use be configured with the [`isolatedModules` flag set to `true`]isolatedModules: true(. * [ts-node](https://www.npmjs.com/package/ts-node) can detect [the `"transpileOnly"` option in the `"ts-node"` field of a `tsconfig.json`, and also has a `--transpile-only` flag](https://www.npmjs.com/package/ts-node#cli-and-programmatic-options). +# Optimizing Editing Experience; Performance of `ts-server` + +In-editor diagnostics are typically fetched a few seconds after typing stops. +`ts-server`'s performance characteristics will always be related to the performance of type-checking your entire project using `tsc`, so the other performance optimization guidance here also applies to improving the editing experience. +As you type, the checker is completely starting from scratch, but it only requests information about what you're typing. +This means that the editing experience can vary based on how much work TypeScript needs to do to check the type of what you are actively editing. +In most editors, like VS Code, diagnostics are requested for all open files, not the entire project. +Accordingly, diagnostics will appear faster compared to checking the entire project with `tsc`, but slower than viewing a type with hover, since viewing a type with hover _only_ asks TypeScript to compute and check that specific type. + # Investigating Issues There are certain ways to get hints of what might be going wrong.