vscode: Slow startup opening a large workspace over the network

Issue Type: Performance Issue

My workspace directory sits on a server in the network, which I access using a mapped network drive. It has about 470,000 files (~36GB) pertaining to about 500 websites. Each website is contained within a folder in the workspace top level, e.g. “T:\vm_sites\example.com", “T:\vm_sites\otherwebsite.org”, and so on.

I open the parent folder (“T:\vm_sites”) instead of just the folder of the website I’ll be working on because then I don’t have to copy workspace settings (including FTP settings for upload) to each of the hundreds of website folders.

Earlier today I started VS Code as usual, by right-clicking on the folder containing all the websites on the network drive and selecting “Open with Code”. VS Code started as usual and, as I was about to start working, I saw a blue mark over the gear icon on the bottom left. Upon hovering it, a tooltip appeared: “Restart to update”, or something to that effect. I clicked on it, VS Code closed, updated to version 1.32.1, and restarted.

Once VS Code started, the file browser pane stayed empty, with a blue bar scrolling horizontally above it (which I believe is a “loading” indicator). Only after a few minutes did the file pane get populated. From then on, VS Code was back to normal.

Just to be sure, once the files pane was populated, I opened a .cshtml file, closed VS Code (leaving the file open), and opened VS Code again. The exact same thing happened (took minutes to load the file pane), but syntax highlighting and the effects of the “indent-rainbow” extension didn’t appear in the editor pane of the opened file until after the files pane was populated.

The issue still happens even if VS Code is started from the command line with “–disable-extensions”.

It seems to me that VS Code is now recursively (and, up to a point, synchronously) scanning the whole workspace directory before populating the files pane and loading/running extensions, which I believe is a change from its behavior up until now. With so many files, over the network, it takes a while. And, while it happens, the files pane can’t be used to open files.

Now, this wouldn’t be as much of an issue if VS Code could open just a subfolder of the workspace and still detect the workspace settings. Then I could just open the folder of the website I’ll be working on instead of the parent folder with all websites, without having to make each and every website a separate workspace—which would bring on the hassle of keeping the settings of hundreds of workspaces in sync.

VS Code version: Code 1.32.1 (05f146c7a8f7f78e80261aa3b2a2e642586f9eb3, 2019-03-08T00:51:49.278Z) OS version: Windows_NT x64 10.0.17763

System Info
Item Value
CPUs Intel® Core™ i7-8700K CPU @ 3.70GHz (12 x 3696)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled
Memory (System) 15.94GB (9.28GB free)
Process Argv
Screen Reader no
VM 0%
Process Info
CPU %	Mem MB	   PID	Process
    0	   119	 17004	code main
    0	   236	  5416	   window (● _Layout.cshtml - vm_sites - Visual Studio Code)
    0	    11	  1696	     watcherService 
    0	    11	 16064	       console-window-host (Windows internal process)
    0	    13	 12536	     electron-crash-reporter
    0	    60	 16820	     extensionHost
    0	    79	 13884	   gpu-process
    0	    67	 16672	   window (Issue Reporter)
    0	    65	 19136	   shared-process
Workspace Info
|  Window (● _Layout.cshtml - vm_sites - Visual Studio Code)
|    Folder (vm_sites): more than 64723 files
|      File types: jpg(15098) js(14499) dll(12581) css(5861) png(5081)
|                  config(1580) map(1513) pdb(1214) xml(791) mno(791)
|      Conf files: csproj(3) sln(2) package.json(2) settings.json(1)
|                  tsconfig.json(1) tslint.json(1);
Extensions (8)
Extension Author (truncated) Version
pascal ale 8.0.0
pascal-formatter ale 2.1.0
haml kar 1.1.0
ftp-sync luk 0.3.9
vscode-apache mrm 1.2.0
indent-rainbow ode 7.2.4
ruby reb 0.22.3
sass-indented rob 1.5.1

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 12
  • Comments: 43 (20 by maintainers)

Commits related to this issue

Most upvoted comments

Can people please try with this build if it still reproduces:

This build removes the changes from https://github.com/Microsoft/vscode/pull/67269 that for me put a lot of pressure right on startup due to extensive file scanning.

The definition of “Large folders” can vary from situation to situation 😃 I’m opening a laravel project in PHP that has about 6700 subfolders. This is a single project having that many folders and it ships like that with composer. So yes this can count as a large project. I’m experiencing the exact same situation as the video but only when using it over a VPN connection. LAN is slower than local but not as slow as VPN.