Skip to content

Commit

Permalink
Merge pull request #325 from jdevries3133/ts_server_perf_details
Browse files Browse the repository at this point in the history
Callout performance characteristics of ts-server
  • Loading branch information
sandersn committed Mar 18, 2024
2 parents 67d077c + 29848d2 commit 055ce10
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 055ce10

Please sign in to comment.