Skip to content

High CPU on large workspace with many TypeScript watched folders #245366

@mustard-mh

Description

@mustard-mh

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.98.2

Important Context:

It affects the browser version of VSCode a lot, as high CPU will make everything feels broken on the browser -> UI stuck, no smart code, not able to open, view, and save files

Steps to Reproduce:

  1. Configure your VS Code settings to make it do not exclude folder like **/node_mudules/**
  2. The builtin TS extension will send lots of watch requests, leads server-main CPU 100% and not able to do anything else for a long time

Example:

Screenshot of that requests

Image

For each new request, the baseWatcher will loop all requests and compute an ID which the result should be same for every request every time

for (const request of requests) {
if (this.isCorrelated(request)) {
this.correlatedWatchRequests.set(request.correlationId, request);
} else {
this.nonCorrelatedWatchRequests.set(this.computeId(request), request);
}
}

Is there a reason why it needs to re-computed?

Metadata

Metadata

Assignees

Labels

confirmedIssue has been confirmed by VS Code Team memberdebtCode quality issuesfile-watcherFile watcherfreeze-slow-crash-leakVS Code crashing, performance, freeze and memory leak issueshelp wantedIssues identified as good community contribution opportunitiesinsiders-releasedPatch has been released in VS Code InsidersverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions