-
Notifications
You must be signed in to change notification settings - Fork 37.4k
Closed
Closed
Copy link
Labels
author-verification-requestedIssues potentially verifiable by issue authorIssues potentially verifiable by issue authorbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugconfirmedIssue has been confirmed by VS Code Team memberIssue has been confirmed by VS Code Team memberfile-watcherFile watcherFile watcherfreeze-slow-crash-leakVS Code crashing, performance, freeze and memory leak issuesVS Code crashing, performance, freeze and memory leak issuesinsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code InsiderstypescriptTypescript support issuesTypescript support issuesverifiedVerification succeededVerification succeeded
Milestone
Description
Does this issue occur when all extensions are disabled?: No
- VS Code Version: 1.96.2
- OS Version: Client = Macos 14.7, Remote = Linux 5.4
Steps to Reproduce:
- Connect to remote ssh
- Open a project with 20000+ .tsx files
- Observe extreme slowness (5+ seconds to respond) with basic editor file actions: open file, save file, close file, etc.
Debugging notes:
- when set typescript output to trace mode I see one watch event per file, e.g.
[trace] <semantic> Event received: createFileWatcher (0). { "id": 364, "path": "/home/peter.elmers/fortesting/generated_tsx_project/src/Component10322.tsx" } - from reading code, looks like this hits the
nonRecursiveWatcherwhich is nodejs: https://github.com/microsoft/vscode/blob/292d0bd51af8d7e107fa34b00955aceb7d9c03d5/src/vs/platform/files/node/watcher/watcher.ts/#L16-L17 - all the watchers pile up and get sent to the nodejs watcher code, I believe that triggers a quadratic time loop in this function: https://github.com/microsoft/vscode/blob/292d0bd51af8d7e107fa34b00955aceb7d9c03d5/src/vs/platform/files/node/watcher/nodejs/nodejsWatcher.ts/#L45-L52
The issue seems to be that every time watchers change then we send in all of the watchers, so the watch code needs to loop through the list many times and find which ones to remove and which ones to keep. But this is just a cursory look.
cc @bpasero
Livven, Krechals and productdevbook
Metadata
Metadata
Labels
author-verification-requestedIssues potentially verifiable by issue authorIssues potentially verifiable by issue authorbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugconfirmedIssue has been confirmed by VS Code Team memberIssue has been confirmed by VS Code Team memberfile-watcherFile watcherFile watcherfreeze-slow-crash-leakVS Code crashing, performance, freeze and memory leak issuesVS Code crashing, performance, freeze and memory leak issuesinsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code InsiderstypescriptTypescript support issuesTypescript support issuesverifiedVerification succeededVerification succeeded