vscode: Very slow start with snap package

Issue Type: Performance Issue

Since upgrade to Ubuntu 18.10 - perhaps related - vscode takes over a minute to start up , maxing out CPU and sending load average soaring. Once system recovers vscode seems normal. However attempting to open a file from command line with command code <filename> returns immediately but takes similar amount of time - up to a minute - before file appears in the editor, though not with same high CPU symptom.

An strace -p to the code process while it’s starting up shows lots of lseek/reads (I’m not sure how to interpret that info to be more helpful) - I presume it’s reading through some massive amount of files/data or something?

VS Code version: Code 1.28.2 (7f3ce96ff4729c91352ae6def877e59c561f4850, 2018-10-17T00:20:56.183Z) OS version: Linux x64 4.15.0-36-generic

System Info
Item Value
CPUs Intel® Core™ i5 CPU M 520 @ 2.40GHz (4 x 1197)
GPU Status 2d_canvas: unavailable_software
checker_imaging: disabled_off
flash_3d: unavailable_software
flash_stage3d: unavailable_software
flash_stage3d_baseline: unavailable_software
gpu_compositing: unavailable_software
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: unavailable_software
video_decode: unavailable_software
video_encode: unavailable_software
webgl: enabled_readback
webgl2: unavailable_off
Load (avg) 2, 2, 2
Memory (System) 7.72GB (0.39GB free)
Process Argv –disable-extensions
Screen Reader no
VM 0%
Process Info
CPU %	Mem MB	   PID	Process
    2	   166	 31313	code main
    0	    40	 31315	   zygote
    0	   119	 31499	     shared-process
   27	   308	 32303	     window (Welcome - mp (Workspace) - Visual Studio Code)
    2	   158	 32326	       extensionHost
    0	     8	 32331	       /bin/bash
    0	    63	 32333	       watcherService
    2	   103	 32509	     window (Issue Reporter)
    0	     0	 32626	   /bin/sh -c /bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=
    0	     0	 32627	     /bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=
Workspace Info
|  Window (Welcome - mp (Workspace) - Visual Studio Code)
|    Folder (gtfe): more than 34258 files
|      File types: png(6182) jpg(4463) py(4080) js(3310) pyc(3056) sql(1670)
|                  pdf(1546) htm(1340) html(1045) ini(481)
|      Conf files: package.json(43) grunt.js(24) gulp.js(7) makefile(6)
|                  launch.json(1) settings.json(1) tslint.json(1)
|      Launch Configs: python(5)
|    Folder (mp): 5300 files
|      File types: py(1689) pyc(1681) h(184) txt(111) so(74) whl(23) exe(20)
|                  rst(18) json(17) conf(12)
|      Conf files: settings.json(1);
Extensions disabled

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 3
  • Comments: 20 (11 by maintainers)

Most upvoted comments

I’ve confirmed with the Snap team that this is an issue on their part. It is related to loading fonts.

  • On 18.04, initial startup is very slow, since loading all the fonts is slow. But fonts actually get cached to ~/.cache/fontconfig. So, successive launches use that cache.
  • On 18.10, font information seems to be RAM only. So, launching is always slow.

The team will address this soon, as far as I was informed.

We fixed this in snapd 2.36.2 which was released last week 😃

@Tyriar @joaomoreno This can be closed.

I believe this has been recently fixed. Start time has turned almost instant.