File watching is registering thousands of redundant watchers #59984
Labels
Needs Investigation
This issue needs a team member to investigate its status.
Milestone
🔎 Search Terms
file watcher performance efficiency watching events
🕗 Version & Regression Information
I am not sure when this changed, but ever since
typescript.tsserver.experimental.useVsCodeWatcher
was added it becomes more visible now, at least to me as owner of the file watcher component in VS Code.⏯ Playground Link
https://github.com/Microsoft/vscode/
💻 Code
No response
🙁 Actual behavior
When you open
vscode
repository (https://github.com/Microsoft/vscode/) and open a TS file (e.g.vs/base/strings.ts
) and wait a bit until the TS/JS language service has settled, notice how there are the following recursive file watchers:node_modules
src/vs
src/@bpasero
,src/node:vm
,src/fs
,... (actually83
more for each and every module we depend on, these folders do not exist on disk)And then there are
>4000
(!) requests for non-recursive files for pretty much every single TS file in the project (for examplesrc/vs/base/browser/ui/menu/menu.ts
).🙂 Expected behavior
A lot less requests for watching:
src/vs
already recursivelysrc/fs
are made up and do not exist, I am not even sure how it would make sense to watchsrc/<node module>
?Additional information about the issue
Here is how you can see the data:
vscode
and a TS file, select "Set Log Level" and pick "Trace" from the command picker//cc @sheetalkamat @DanielRosenwasser
The text was updated successfully, but these errors were encountered: