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

Tasks: Run Task command performance is slow in monorepo #163143

Closed
rxliuli opened this issue Oct 10, 2022 · 5 comments
Closed

Tasks: Run Task command performance is slow in monorepo #163143

rxliuli opened this issue Oct 10, 2022 · 5 comments
Assignees

Comments

@rxliuli
Copy link

rxliuli commented Oct 10, 2022

Type: Performance Issue

I have 100+ modules in a pnpm monorepo in production and I have to run npm scripts across modules every day, but when I try to use Run Task to display npm scripts that have been run before, it waits a few seconds for it to appear , I also encountered this problem in a project in production environment.
What I want to know is: when using the command, will the whole monorepo be scanned? If you do, it will be really slow.

Run Task 性能问题


Update

When I use the latest Visual Studio Code - Insiders, the performance is normal, but even with all plugins disabled, the problem persists in the stable version of VSCode, I suspect it may be caused by some cache, but I'm not sure how to debug

VS Code version: Code 1.72.0 (64bbfbf, 2022-10-04T23:20:39.912Z)
OS version: Windows_NT x64 10.0.19044
Modes:
Sandboxed: No

System Info
Item Value
CPUs Intel(R) Core(TM) i7-10875H CPU @ 2.30GHz (16 x 2304)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) undefined
Memory (System) 63.87GB (31.14GB free)
Process Argv --crash-reporter-id c3d9efe9-27d1-457c-92ad-051b9d276383
Screen Reader no
VM 0%
Process Info
CPU %	Mem MB	   PID	Process
    0	   134	  5944	code main
    0	    22	  3132	   utility-network-service
    0	    84	  5236	   shared-process
    0	    32	  1436	     fileWatcher
    0	    39	  2396	     fileWatcher
    0	    73	  5696	     ptyHost
    0	     6	  1564	       console-window-host (Windows internal process)
    0	     5	  7160	       "C:\Program Files\Git\bin\bash.exe"
    0	    11	  7308	         "C:\Program Files\Git\bin\..\usr\bin\bash.exe"
    0	     6	  8676	       console-window-host (Windows internal process)
    0	     5	  8792	       "C:\Program Files\Git\bin\bash.exe"
    0	    10	 15120	         "C:\Program Files\Git\bin\..\usr\bin\bash.exe"
    0	     6	  9128	       console-window-host (Windows internal process)
    0	     5	  9320	       "C:\Program Files\Git\bin\bash.exe"
    0	     7	  4028	         "C:\Program Files\Git\bin\..\usr\bin\bash.exe"
    0	     4	 10844	       "C:\Program Files\Git\bin\bash.exe"
    0	     8	 18508	         "C:\Program Files\Git\bin\..\usr\bin\bash.exe"
    0	     5	 12352	       "C:\Program Files\Git\bin\bash.exe"
    0	     7	  3020	         "C:\Program Files\Git\bin\..\usr\bin\bash.exe"
    0	     6	 13552	       console-window-host (Windows internal process)
    0	     5	 15620	       console-window-host (Windows internal process)
    0	     6	 16184	       console-window-host (Windows internal process)
    0	     4	 16312	       "C:\Program Files\Git\bin\bash.exe"
    0	     6	  2280	         "C:\Program Files\Git\bin\..\usr\bin\bash.exe"
    0	     6	 16376	           "C:\Program Files\Git\bin\..\usr\bin\bash.exe"
    0	    76	  3184	             C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe
    0	     6	 17656	       console-window-host (Windows internal process)
    0	     5	 18204	       "C:\Program Files\Git\bin\bash.exe"
    0	    11	  3688	         "C:\Program Files\Git\bin\..\usr\bin\bash.exe"
    0	     6	 18400	       console-window-host (Windows internal process)
    0	     5	 19756	       "C:\Program Files\Git\bin\bash.exe"
    0	    10	  8632	         "C:\Program Files\Git\bin\..\usr\bin\bash.exe"
    0	     4	 20292	       "C:\Program Files\Git\bin\bash.exe"
    0	     8	 12280	         "C:\Program Files\Git\bin\..\usr\bin\bash.exe"
    0	     5	 22064	       "C:\Program Files\Git\bin\bash.exe"
    0	    10	 13928	         "C:\Program Files\Git\bin\..\usr\bin\bash.exe"
    0	     7	 22300	       console-window-host (Windows internal process)
    0	     6	 22312	       console-window-host (Windows internal process)
    0	    89	 19864	     fileWatcher
    0	    41	 19960	     fileWatcher
    0	   135	  7772	   extensionHost
    0	    72	  8776	     "C:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node "c:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\json-language-features\server\dist\node\jsonServerMain" --node-ipc --clientProcessId=7772
    0	    84	 14512	     "C:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node --max-old-space-size=3072 "c:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js" --useInferredProjectPerProjectRoot --enableTelemetry --cancellationPipeName C:\Users\rxliuli\AppData\Local\Temp\vscode-typescript\007c1055ff59abfd39df\tscancellation-6b0d46fdae9cd034717b.tmp* --locale zh-cn --noGetErrOnBackgroundUpdate --validateDefaultNpmLocation --useNodeIpc
    0	    34	 18536	       "C:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node "c:/Users/rxliuli/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/node_modules/typescript/lib/typingsInstaller.js" --globalTypingsCacheLocation C:/Users/rxliuli/AppData/Local/Microsoft/TypeScript/4.8 --enableTelemetry --typesMapLocation "c:/Users/rxliuli/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/node_modules/typescript/lib/typesMap.json" --validateDefaultNpmLocation
    0	    39	 15276	     "C:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node c:\Users\rxliuli\.vscode\extensions\visualstudioexptteam.intellicode-api-usage-examples-0.2.4\dist\server\server.js --node-ipc --clientProcessId=7772
    0	    85	 18796	     "C:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node c:\Users\rxliuli\.vscode\extensions\streetsidesoftware.code-spell-checker-2.10.1\packages\_server\dist\main.js --node-ipc --clientProcessId=7772
    0	    44	 19040	     "C:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node --max-old-space-size=3072 "c:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js" --serverMode partialSemantic --useInferredProjectPerProjectRoot --disableAutomaticTypingAcquisition --cancellationPipeName C:\Users\rxliuli\AppData\Local\Temp\vscode-typescript\007c1055ff59abfd39df\tscancellation-079c89d1c631a642dff8.tmp* --locale zh-cn --noGetErrOnBackgroundUpdate --validateDefaultNpmLocation --useNodeIpc
    0	    10	 10108	   crashpad-handler
    0	   212	 10132	   window (liuli-tools - Visual Studio Code)
    0	   166	 11544	   extensionHost
    0	    86	  8860	     "C:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node "c:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\json-language-features\server\dist\node\jsonServerMain" --node-ipc --clientProcessId=11544
    0	   119	 11440	     "C:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node c:\Users\rxliuli\.vscode\extensions\streetsidesoftware.code-spell-checker-2.10.1\packages\_server\dist\main.js --node-ipc --clientProcessId=11544
    0	   102	 14968	   issue-reporter
    0	   276	 16124	   window (abstractTaskService.ts - vscode - Visual Studio Code)
    0	   246	 16788	   extensionHost
    0	   844	  1160	     "C:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node c:\Users\rxliuli\.vscode\extensions\vue.volar-1.0.1-win32-x64\server.js --node-ipc --clientProcessId=16788
    0	    96	  6472	     "C:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node c:\Users\rxliuli\.vscode\extensions\visualstudioexptteam.intellicode-api-usage-examples-0.2.4\dist\server\server.js --node-ipc --clientProcessId=16788
    0	    61	  6500	     "C:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node "c:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\json-language-features\server\dist\node\jsonServerMain" --node-ipc --clientProcessId=16788
    0	    70	  6868	     "C:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node c:\Users\rxliuli\.vscode\extensions\streetsidesoftware.code-spell-checker-2.10.1\packages\_server\dist\main.js --node-ipc --clientProcessId=16788
    0	    41	  7460	     "C:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node c:\Users\rxliuli\.vscode\extensions\graphql.vscode-graphql-0.7.5\out\server\index.js --node-ipc --clientProcessId=16788
    0	    49	  8204	     "C:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node c:\Users\rxliuli\.vscode\extensions\vue.volar-1.0.1-win32-x64\server.js --node-ipc --clientProcessId=16788
    0	   139	 14544	     "C:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node --max-old-space-size=3072 "c:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js" --serverMode partialSemantic --useInferredProjectPerProjectRoot --disableAutomaticTypingAcquisition --cancellationPipeName C:\Users\rxliuli\AppData\Local\Temp\vscode-typescript\6cacbbdb4132274cdb67\tscancellation-78b2b297b52a270daee3.tmp* --locale zh-cn --noGetErrOnBackgroundUpdate --validateDefaultNpmLocation --useNodeIpc
    0	   335	 15288	     "C:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node --max-old-space-size=3072 "c:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js" --useInferredProjectPerProjectRoot --enableTelemetry --cancellationPipeName C:\Users\rxliuli\AppData\Local\Temp\vscode-typescript\6cacbbdb4132274cdb67\tscancellation-99dfffcd38906a00958a.tmp* --locale zh-cn --noGetErrOnBackgroundUpdate --validateDefaultNpmLocation --useNodeIpc
    0	   102	 18800	       "C:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node "c:/Users/rxliuli/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/node_modules/typescript/lib/typingsInstaller.js" --globalTypingsCacheLocation C:/Users/rxliuli/AppData/Local/Microsoft/TypeScript/4.8 --enableTelemetry --typesMapLocation "c:/Users/rxliuli/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/node_modules/typescript/lib/typesMap.json" --validateDefaultNpmLocation
    0	    30	 16152	     "C:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node "c:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\css-language-features\server\dist\node\cssServerMain" --node-ipc --clientProcessId=16788
    0	    27	 21292	     "C:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node "c:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\markdown-language-features\server\dist\node\main" --node-ipc --clientProcessId=16788
    0	    26	 21992	     "C:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node "c:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\html-language-features\server\dist\node\htmlServerMain" --node-ipc --clientProcessId=16788
    0	   342	 17608	   extensionHost
    0	    48	  4688	     "C:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node --max-old-space-size=3072 "c:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js" --serverMode partialSemantic --useInferredProjectPerProjectRoot --disableAutomaticTypingAcquisition --cancellationPipeName C:\Users\rxliuli\AppData\Local\Temp\vscode-typescript\9eb659aad3b205994508\tscancellation-9d605d5cceb95490a5df.tmp* --locale zh-cn --noGetErrOnBackgroundUpdate --validateDefaultNpmLocation --useNodeIpc
    0	   272	  9708	     "C:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node --max-old-space-size=3072 "c:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js" --useInferredProjectPerProjectRoot --enableTelemetry --cancellationPipeName C:\Users\rxliuli\AppData\Local\Temp\vscode-typescript\9eb659aad3b205994508\tscancellation-281b42d61a81db861dea.tmp* --locale zh-cn --noGetErrOnBackgroundUpdate --validateDefaultNpmLocation --useNodeIpc
    0	    28	  4868	       "C:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node "c:/Users/rxliuli/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/node_modules/typescript/lib/typingsInstaller.js" --globalTypingsCacheLocation C:/Users/rxliuli/AppData/Local/Microsoft/TypeScript/4.8 --enableTelemetry --typesMapLocation "c:/Users/rxliuli/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/node_modules/typescript/lib/typesMap.json" --validateDefaultNpmLocation
    0	    41	 11448	     "C:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node c:\Users\rxliuli\.vscode\extensions\visualstudioexptteam.intellicode-api-usage-examples-0.2.4\dist\server\server.js --node-ipc --clientProcessId=17608
    0	    75	 17048	     "C:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node "c:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\json-language-features\server\dist\node\jsonServerMain" --node-ipc --clientProcessId=17608
    0	    71	 20064	     "C:\Users\rxliuli\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node c:\Users\rxliuli\.vscode\extensions\streetsidesoftware.code-spell-checker-2.10.1\packages\_server\dist\main.js --node-ipc --clientProcessId=17608
    0	   188	 18816	   gpu-process
    0	   212	 20620	   window (DateRangePickerView.tsx - mrn - Visual Studio Code)
    0	   474	 20996	   window (App.vue - matrix - Visual Studio Code)
Workspace Info
|  Window (liuli-tools - Visual Studio Code)
|  Window (DateRangePickerView.tsx - mrn - Visual Studio Code)
|  Window (abstractTaskService.ts - vscode - Visual Studio Code)
|  Window (App.vue - matrix - Visual Studio Code)
|    Folder (liuli-tools): 4153 files
|      File types: len(648) ts(501) storage(295) ver(213) xml(189) map(184)
|                  json(150) js(85) md(79) at(79)
|      Conf files: package.json(66) tsconfig.json(57)
|    Folder (mrn): 5469 files
|      File types: flat(952) so(936) xml(801) png(391) json(287) ts(113)
|                  tsx(64) java(47) h(30) class(28)
|      Conf files: package.json(13) tsconfig.json(8) settings.json(1)
|    Folder (vscode): 8005 files
|      File types: ts(4011) json(639) js(247) css(210) lock(101)
|                  vscodeignore(86) md(76) txt(76) svg(76) png(68)
|      Conf files: package.json(105) tsconfig.json(48) github-actions(24)
|                  launch.json(20) tasks.json(13) settings.json(9)
|                  gulp.js(2) devcontainer.json(1) jsconfig.json(1)
|                  dockerfile(1) makefile(1) webpack.config.js(1)
|      Launch Configs: node(14) extensionHost(10) chrome(5) msedge(2)
|    Folder (matrix): 9150 files
|      File types: ts(2542) js(1007) vue(686) json(482) md(330) svg(318)
|                  map(275) html(225) png(200) gitignore(81)
|      Conf files: package.json(155) tsconfig.json(141) dockerfile(4)
|                  settings.json(3) devcontainer.json(1) launch.json(1)
|                  gulp.js(1) tslint.json(1)
|      Launch Configs: pwa-chrome;
Extensions (25)
Extension Author (truncated) Version
path-intellisense chr 2.8.1
vscode-markdownlint Dav 0.48.1
gitlens eam 12.2.2
vscode-mindmap eig 0.0.16
prettier-vscode esb 9.9.0
vscode-graphql Gra 0.7.5
vscode-graphql-syntax Gra 1.0.4
vscode-drawio hed 1.6.4
rest-client hum 0.25.1
comment-translate int 2.2.4
svg joc 1.4.20
intellij-idea-keybindings k-- 1.5.3
vscode-language-pack-zh-hans MS- 1.72.10050946
vsliveshare ms- 1.0.5733
vsliveshare-audio ms- 0.1.91
vsliveshare-pack ms- 0.4.0
joplin-vscode-plugin rxl 0.8.2
new-project rxl 0.3.0
tsx rxl 0.1.3
code-spell-checker str 2.10.1
intellicode-api-usage-examples Vis 0.2.4
vscode-icons vsc 11.20.0
volar Vue 1.0.3
markdown-all-in-one yzh 3.4.3
vitest-explorer Zix 0.2.29
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscoreces:30445986
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593:30376534
pythonvs932:30410667
cppdebug:30492333
vsclangdc:30486549
c4g48928:30535728
dsvsc012:30540252
azure-dev_surveyone:30548225
i497e931:30553904
pyindex848:30577860
fc301958:30573243

@meganrogge
Copy link
Contributor

This is already fixed in insiders

@david-morris
Copy link

This is not fixed in 1.72.2.

Version: 1.72.2 (system setup)
Commit: d045a5eda657f4d7b676dedbfa7aab8207f8a075
Date: 2022-10-12T22:15:18.074Z
Electron: 19.0.17
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Windows_NT x64 10.0.22000
Sandboxed: No

Does that mean this was closed because it wasn't successfully reproduced, and should be reopened?

Previously, there was some sort of cache of recently used tasks that I could start before the automatically collected ones showed up. Now the task menu doesn't show up until they have all loaded.

I'm using a remote container/local docker setup with a monorepo and this makes tasks unusable. I counted a full minute of lag on opening the task window. I see 30 tasks in that list, and I wonder if this is fetching a lot of items and cutting them off by priority.

I'm also thinking that this could have something to do with clean handling of addons acting weird. I noticed that some of the menu items are NX generators with different parameters.

One possible solution would be to organize auto-generated tasks under menu items in the main task menu (as well as pinned and recently used tasks) and to start a thread fetching auto-generated tasks while that runs. In general though, the list of auto-detected tasks doesn't change often for me, and I'm surprised I don't see more caching on this.

@meganrogge
Copy link
Contributor

@david-morris thanks for the info. Can you pls see if you can repro the issue in the insider's build?

@rxliuli
Copy link
Author

rxliuli commented Oct 25, 2022

@david-morris thanks for the info. Can you pls see if you can repro the issue in the insider's build?

The latest version of vscode doesn't fix it, and the reason for no reply after that is just that I don't know how to reproduce it in vscode insiders. I thought it was equivalent to a feature of jetbrains webstorm, but since I couldn't provide a reproduction, I stopped using this feature and didn't reopen the issue.

@david-morris
Copy link

@meganrogge unable to reproduce in insiders 👍

So I'm having trouble understanding your release cadence, is there something I can read to understand how long bugfixes will stay in insiders before being released? I only posted this because I couldn't find anything on this except the "Date" field on the about page.

It takes well over a half hour to get an insider build running my container, so I'm hoping to reduce release-hopping.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants