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

Very slow start with snap package #61613

Closed
nickyspag opened this issue Oct 23, 2018 · 20 comments
Closed

Very slow start with snap package #61613

nickyspag opened this issue Oct 23, 2018 · 20 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug linux Issues with VS Code on Linux perf perf-startup snap Issues related to the snap package upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Milestone

Comments

@nickyspag
Copy link

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 (7f3ce96, 2018-10-17T00:20:56.183Z)
OS version: Linux x64 4.15.0-36-generic

System Info
Item Value
CPUs Intel(R) Core(TM) 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
@nickyspag
Copy link
Author

b076-main.cpuprofile.txt

@nickyspag
Copy link
Author

A further observation: opening a file from the quick file picker (ctrl + p) opens quickly, as does opening file from traditional file open dialog (ctrl + o).

@nickyspag
Copy link
Author

I noticed vscode was installed as a snap not a traditional .deb package, so I removed the snap and installed from downloaded .deb:

sudo snap remove vscode
sudo dpkg -i code_1.28.2-1539735992_amd64.deb

and now vscode is behaving normally!

@jrieken
Copy link
Member

jrieken commented Oct 23, 2018

I noticed vscode was installed as a snap not a traditional .deb package,

@Tyriar you talked about this once, right?

@jrieken
Copy link
Member

jrieken commented Oct 23, 2018

screenshot 2018-10-23 at 15 57 05

So, there is a v e r y long time in which nothing JavaScript'ish happens. This is mostly likely a delayed app read event. @nickyspag Do you still have the snap install? Can copy/paste what's being printed when calling "F1 > Startup Performance"?

@jrieken jrieken added linux Issues with VS Code on Linux perf-startup info-needed Issue requires more information from poster labels Oct 23, 2018
@nickyspag
Copy link
Author

@jrieken I uninstalled the snap, so that I could get some work done :-) but can easily reinstall it... BUT there is no visible window during the long startup for me to press F1 in ... is there another way (like with command line params) that I can get more useful info for you?

There is a warning when installing the vscode snap about it being a "classic" snap and one has to add the --classic option to get it to install - I know precious little about snaps but maybe something to do with it?

@jrieken
Copy link
Member

jrieken commented Oct 23, 2018

BUT there is no visible window during the long startup for me to press F1 in ... is there another way

Does it not finish? Eventually, when a window is being shown F1 should be functional...

I know precious little about snaps but maybe something to do with it?

I know less but yeah sounds like this is a snap issue.

@nickyspag
Copy link
Author

Sorry I thought you meant wHILE it was opening.

Here's what's in the Startup Performance console after starting the snap version:

image
-1540305625449.log

@jrieken
Copy link
Member

jrieken commented Oct 23, 2018

Thanks - it apparently takes 77018ms to receive the app ready event from electron (main:started till main:appReady). During that time we are hand-cuffed, electron started us be we can do much yet cos we wait for outside things...

@jrieken
Copy link
Member

jrieken commented Oct 23, 2018

This is maybe the same as or very much related to #22087

@jrieken jrieken added perf and removed info-needed Issue requires more information from poster labels Oct 23, 2018
@zerkz
Copy link

zerkz commented Oct 25, 2018

I am having the same experience after upgrading to cosmic (ubuntu 18.10), using the snap version. Going to install the deb binary and see how that works out!

-v output

1.28.2
7f3ce96ff4729c91352ae6def877e59c561f4850
x64

Startup Performance:
image

image

@zerkz
Copy link

zerkz commented Oct 25, 2018

Here's my times after the latest 64-bit deb install. MUCH faster.

-v output

1.28.2
7f3ce96ff4729c91352ae6def877e59c561f4850
x64

image

@jrieken
Copy link
Member

jrieken commented Oct 28, 2018

@Tyriar slow, snap, rings a bell?

@huan
Copy link

huan commented Nov 3, 2018

I have the same problem after I upgraded to Ubuntu 18.10 with snap version of vscode.

@jrieken jrieken assigned joaomoreno and unassigned Tyriar Nov 5, 2018
@jrieken jrieken changed the title Very Slow to Start up and very slow to open file from command line [linux] Very Slow to Start with snap package Nov 5, 2018
@joaomoreno joaomoreno added the snap Issues related to the snap package label Nov 5, 2018
@joaomoreno joaomoreno added this to the Backlog milestone Nov 5, 2018
@joaomoreno joaomoreno added the bug Issue identified by VS Code Team member as probable bug label Nov 5, 2018
@joaomoreno joaomoreno changed the title [linux] Very Slow to Start with snap package Very Slow to Start with snap package Nov 5, 2018
@joaomoreno joaomoreno changed the title Very Slow to Start with snap package Very slow start with snap package Nov 5, 2018
@joaomoreno joaomoreno added the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label Nov 6, 2018
@joaomoreno
Copy link
Member

joaomoreno commented Nov 6, 2018

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.

@joaomoreno
Copy link
Member

I've gotten a very promising update on a snapd fix:

  • Cold start launch time was reduced from ~1min 37secs to ~23secs
  • Hot start lunch time was reduced from 1min 32secs to ~5secs

This was done on the same machine running 18.10 with those latest changes. I was told the changes are not out yet, but coming soon.

@jrieken
Copy link
Member

jrieken commented Dec 3, 2018

Much better but still slow. Having 23secs for the first startup isn't something I would endure, esp. not as an Insiders user. Do they have plans to make this fast?

@scruti
Copy link

scruti commented Dec 13, 2018

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

@flexiondotorg
Copy link
Contributor

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

@flexiondotorg
Copy link
Contributor

flexiondotorg commented Jan 11, 2019

@Tyriar @joaomoreno This can be closed.

@Tyriar Tyriar closed this as completed Jan 11, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Feb 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug linux Issues with VS Code on Linux perf perf-startup snap Issues related to the snap package upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

8 participants