Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initializing js/ts language features extremely slow on WSL2 #87921

Closed
andreialecu opened this issue Dec 31, 2019 · 4 comments
Closed

Initializing js/ts language features extremely slow on WSL2 #87921

andreialecu opened this issue Dec 31, 2019 · 4 comments
Labels
terminal Integrated terminal issues

Comments

@andreialecu
Copy link

Issue Type: Bug

I have a specific workspace created using yarn workspaces that when opened in WSL2 will never complete the "Initializing ts/js language features" step.

The problem seems to be the same as the one reported in this comment here, in an issue that was previously closed: #79380 (comment)

The last line in tsserver.log is related to an AddWatch to the main node_modules of the workspace on WSL2. No other errors otherwise.

The same tsserver.log when using Windows quickly passes that step.

The node_modules in the root of the workspace is 815MB and has 77593 files.

VS Code version: Code 1.41.1 (26076a4, 2019-12-18T14:58:56.166Z)
OS version: Windows_NT x64 10.0.19041

System Info
Item Value
CPUs Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz (8 x 4200)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off
surface_control: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.96GB (1.63GB free)
Process Argv
Screen Reader no
VM 0%
@vscodebot vscodebot bot added the terminal Integrated terminal issues label Dec 31, 2019
@andreialecu
Copy link
Author

andreialecu commented Dec 31, 2019

Last lines of tsserver.log on wsl2:

Info 55   [11:58:12.862] Starting updateGraphWorker: Project: /s/Projects/zzz/packages/yyy/tsconfig.json
Info 56   [11:58:13.399] DirectoryWatcher:: Added:: WatchInfo: /s/Projects/zzz/node_modules 1 Project:  WatchType: node_modules for closed script infos in them

Similar relevant lines from tsserver.log while in Windows mode:

Info 60   [11:43:39.4] Starting updateGraphWorker: Project: s:/Projects/zzz/packages/yyy/tsconfig.json
Info 61   [11:43:39.86] DirectoryWatcher:: Added:: WatchInfo: s:/projects/zzz/node_modules 1 Project:  WatchType: node_modules for closed script infos in them
Info 62   [11:43:39.86] watchDirectory for s:/projects/zzz/node_modules uses cached drive information.
Info 63   [11:43:39.87] Elapsed:: 1ms DirectoryWatcher:: Added:: WatchInfo: s:/projects/zzz/node_modules 1 Project:  WatchType: node_modules for closed script infos in them

@andreialecu
Copy link
Author

Interesting, I've left it open for a bit and it wasn't actually hung, it just took a very long time:

Info 56   [11:58:13.399] DirectoryWatcher:: Added:: WatchInfo: /s/Projects/zzz/node_modules 1 Project:  WatchType: node_modules for closed script infos in them
Info 57   [12:3:34.559] Elapsed:: 321159ms DirectoryWatcher:: Added:: WatchInfo: /s/Projects/zzz/node_modules 1 Project:  WatchType: node_modules for closed script infos in them
Info 58   [12:3:34.575] DirectoryWatcher:: Added:: WatchInfo: /s/Projects/zzz/packages/yyy/src 1 Project: /s/Projects/zzz/packages/lets-poker-shared/tsconfig.json WatchType: Failed Lookup Locations

Over 5 minutes on wsl2. Instant on Windows.

@andreialecu
Copy link
Author

andreialecu commented Dec 31, 2019

As a troubleshooting step, I tried the latest nightly of typescript based on this PR: microsoft/TypeScript#35615 (comment)

Info 0    [12:20:46.505] Starting TS Server
Info 1    [12:20:46.505] Version: 3.8.0-dev.20191231

But it didn't help, same behavior.

Edit: Also found: microsoft/TypeScript#33335

@andreialecu andreialecu changed the title Initializing js/ts language features never completes on WSL2 Initializing js/ts language features extremely slow on WSL2 Dec 31, 2019
@andreialecu
Copy link
Author

andreialecu commented Dec 31, 2019

The issue seems to be: microsoft/WSL#4197

For now it seems that cloning the repository on the ext4 file system of wsl is the way to go. Everything is much faster, and on par with Windows performance after moving the repo and opening from ext4.

Log for reference:

Info 122  [14:14:45.198] Starting updateGraphWorker: Project: /home/aandrei/projects/zzz/tsconfig.json
Info 123  [14:14:45.234] DirectoryWatcher:: Added:: WatchInfo: /home/aandrei/zzz/node_modules 1 Project:  WatchType: node_modules for closed script infos in them
Info 124  [14:14:46.347] Elapsed:: 1113ms DirectoryWatcher:: Added:: WatchInfo: /home/aandrei/zzz/node_modules 1 Project:  WatchType: node_modules for closed script infos in them

@vscodebot vscodebot bot locked and limited conversation to collaborators Feb 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
terminal Integrated terminal issues
Projects
None yet
Development

No branches or pull requests

1 participant