Skip to content

TS Server high cpu usage after yarn install #37653

Closed
@mjbvz

Description

@mjbvz

TypeScript Version: 3.9.0-dev.20200316

Search Terms:

  • tsserver
  • yarn install / npm install
  • performance cpu

Repro

  1. In the VS Code code base
  2. Open a ts file under src
  3. Wait for initialization to finish
  4. Then run yarn

Bug
The CPU usage of TS Server remained high for about 10 minutes after doing this. In the TS Server logs, I see a huge block of logged lines that look like:

Info 10105[13:17:2.614] Elapsed:: 0ms DirectoryWatcher:: Triggered with /users/matb/projects/vscode/node_modules/glob-watcher/node_modules/fsevents/node_modules/strip-ansi :: WatchInfo: /users/matb/projects/vscode/node_modules 1 {"watchFile":3} Project:  WatchType: node_modules for closed script infos in them
Info 10106[13:17:2.614] DirectoryWatcher:: Triggered with /users/matb/projects/vscode/node_modules/glob-watcher/node_modules/fsevents/node_modules/wide-align :: WatchInfo: /users/matb/projects/vscode/node_modules 1 {"watchFile":3} Project:  WatchType: node_modules for closed script infos in them
Info 10107[13:17:2.614] Elapsed:: 0ms DirectoryWatcher:: Triggered with /users/matb/projects/vscode/node_modules/glob-watcher/node_modules/fsevents/node_modules/wide-align :: WatchInfo: /users/matb/projects/vscode/node_modules 1 {"watchFile":3} Project:  WatchType: node_modules for closed script infos in them
Info 10108[13:17:2.614] DirectoryWatcher:: Triggered with /users/matb/projects/vscode/node_modules/glob-watcher/node_modules/fsevents/node_modules/util-deprecate :: WatchInfo: /users/matb/projects/vscode/node_modules 1 {"watchFile":3} Project:  WatchType: node_modules for closed script infos in them
Info 10109[13:17:2.614] Elapsed:: 0ms DirectoryWatcher:: Triggered with /users/matb/projects/vscode/node_modules/glob-watcher/node_modules/fsevents/node_modules/util-deprecate :: WatchInfo: /users/matb/projects/vscode/node_modules 1 {"watchFile":3} Project:  WatchType: node_modules for closed script infos in them
Info 10110[13:17:2.614] DirectoryWatcher:: Triggered with /users/matb/projects/vscode/node_modules/glob-watcher/node_modules/fsevents/node_modules/wrappy :: WatchInfo: /users/matb/projects/vscode/node_modules 1 {"watchFile":3} Project:  WatchType: node_modules for closed script infos in them
Info 10111[13:17:2.614] Elapsed:: 0ms DirectoryWatcher:: Triggered with /users/matb/projects/vscode/node_modules/glob-watcher/node_modules/fsevents/node_modules/wrappy :: WatchInfo: /users/matb/projects/vscode/node_modules 1 {"watchFile":3} Project:  WatchType: node_modules for closed script infos in them
Info 10112[13:17:2.614] DirectoryWatcher:: Triggered with /users/matb/projects/vscode/node_modules/glob-watcher/node_modules/fsevents/node_modules/yallist :: WatchInfo: /users/matb/projects/vscode/node_modules 1 {"watchFile":3} Project:  WatchType: node_modules for closed script infos in them
Info 10113[13:17:2.614] Elapsed:: 0ms DirectoryWatcher:: Triggered with /users/matb/projects/vscode/node_modules/glob-watcher/node_modules/fsevents/node_modules/yallist :: WatchInfo: /users/matb/projects/vscode/node_modules 1 {"watchFile":3} Project:  WatchType: node_modules for closed script infos in them
Info 10114[13:17:2.614] DirectoryWatcher:: Triggered with /users/matb/projects/vscode/node_modules/glob-watcher/node_modules/fsevents/node_modules/strip-json-comments :: WatchInfo: /users/matb/projects/vscode/node_modules 1 {"watchFile":3} Project:  WatchType: node_modules for closed script infos in them
Info 10115[13:17:2.614] Elapsed:: 0ms DirectoryWatcher:: Triggered with /users/matb/projects/vscode/node_modules/glob-watcher/node_modules/fsevents/node_modules/strip-json-comments :: WatchInfo: /users/matb/projects/vscode/node_modules 1 {"watchFile":3} Project:  WatchType: node_modules for closed script infos in them
Info 10116[13:17:2.614] DirectoryWatcher:: Triggered with /users/matb/projects/vscode/node_modules/glob-watcher/node_modules/fsevents/node_modules/tar :: WatchInfo: /users/matb/projects/vscode/node_modules 1 {"watchFile":3} Project:  WatchType: node_modules for closed script infos in them
Info 10117[13:17:2.614] Elapsed:: 0ms DirectoryWatcher:: Triggered with /users/matb/projects/vscode/node_modules/glob-watcher/node_modules/fsevents/node_modules/tar :: WatchInfo: /users/matb/projects/vscode/node_modules 1 {"watchFile":3} Project:  WatchType: node_modules for closed script infos in them
Info 10118[13:17:2.614] DirectoryWatcher:: Triggered with /Users/matb/projects/vscode/node_modules/glob-watcher/node_modules/fsevents/node_modules/aproba :: WatchInfo: /Users/matb/projects/vscode/node_modules 1 {"watchFile":3} Project: /Users/matb/projects/vscode/src/tsconfig.json WatchType: Failed Lookup Locations
Info 10119[13:17:2.977] Elapsed:: 363ms DirectoryWatcher:: Triggered with /Users/matb/projects/vscode/node_modules/glob-watcher/node_modules/fsevents/node_modules/aproba :: WatchInfo: /Users/matb/projects/vscode/node_modules 1 {"watchFile":3} Project: /Users/matb/projects/vscode/src/tsconfig.json WatchType: Failed Lookup Locations
Info 10120[13:17:2.977] DirectoryWatcher:: Triggered with /Users/matb/projects/vscode/node_modules/glob-watcher/node_modules/fsevents/node_modules/are-we-there-yet :: WatchInfo: /Users/matb/projects/vscode/node_modules 1 {"watchFile":3} Project: /Users/matb/projects/vscode/src/tsconfig.json WatchType: Failed Lookup Locations
Info 10121[13:17:3.344] Elapsed:: 367ms DirectoryWatcher:: Triggered with /Users/matb/projects/vscode/node_modules/glob-watcher/node_modules/fsevents/node_modules/are-we-there-yet :: WatchInfo: /Users/matb/projects/vscode/node_modules 1 {"watchFile":3} Project: /Users/matb/projects/vscode/src/tsconfig.json WatchType: Failed Lookup Locations
Info 10122[13:17:3.344] DirectoryWatcher:: Triggered with /Users/matb/projects/vscode/node_modules/glob-watcher/node_modules/fsevents/node_modules/ansi-regex :: WatchInfo: /Users/matb/projects/vscode/node_modules 1 {"watchFile":3} Project: /Users/matb/projects/vscode/src/tsconfig.json WatchType: Failed Lookup Locations
Info 10123[13:17:3.736] Elapsed:: 392ms DirectoryWatcher:: Triggered with /Users/matb/projects/vscode/node_modules/glob-watcher/node_modules/fsevents/node_modules/ansi-regex :: WatchInfo: /Users/matb/projects/vscode/node_modules 1 {"watchFile":3} Project: /Users/matb/projects/vscode/src/tsconfig.json WatchType: Failed Lookup Locations
Info 10124[13:17:3.736] DirectoryWatcher:: Triggered with /Users/matb/projects/vscode/node_modules/glob-watcher/node_modules/fsevents/node_modules/abbrev :: WatchInfo: /Users/matb/projects/vscode/node_modules 1 {"watchFile":3} Project: /Users/matb/projects/vscode/src/tsconfig.json WatchType: Failed Lookup Locations
Info 10125[13:17:4.107] Elapsed:: 371ms DirectoryWatcher:: Triggered with /Users/matb/projects/vscode/node_modules/glob-watcher/node_modules/fsevents/node_modules/abbrev :: WatchInfo: /Users/matb/projects/vscode/node_modules 1 {"watchFile":3} Project: /Users/matb/projects/vscode/src/tsconfig.json WatchType: Failed Lookup Locations
Info 10126[13:17:4.107] DirectoryWatcher:: Triggered with /Users/matb/projects/vscode/node_modules/glob-watcher/node_modules/fsevents/node_modules/code-point-at :: WatchInfo: /Users/matb/projects/vscode/node_modules 1 {"watchFile":3} Project: /Users/matb/projects/vscode/src/tsconfig.json WatchType: Failed Lookup Locations
Info 10127[13:17:4.518] Elapsed:: 411ms DirectoryWatcher:: Triggered with /Users/matb/projects/vscode/node_modules/glob-watcher/node_modules/fsevents/node_modules/code-point-at :: WatchInfo: /Users/matb/projects/vscode/node_modules 1 {"watchFile":3} Project: /Users/matb/projects/vscode/src/tsconfig.json WatchType: Failed Lookup Locations
Info 10

Metadata

Metadata

Assignees

Labels

Fix AvailableA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.VS Code PriorityCritical issues that VS Code needs fixed in the current TypeScript milestone

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions