Vscode slow startup on archlinux

Hi, I have an issue with vscode on archlinux, It is really slow to start. It takes 35 seconds to start (no disk activity during that time). I have Ubuntu 18.04 on the same machine and vscode snap works fine there.

The first time startup is always slower due to font cache regeneration etc., it this issue reproducible after the first time launch?

I have this problem on every launch, and only with vscode on archlinux , other applications, including electron apps (Discord, Gitkraken) , works fine, and vscode on Ubuntu launch fine and fast. The 35 seconds I mentioned are on a hot start. There is no disk activity during that time.

1 Like

I’m keen to understand how we can effectively measure what’s causing these speed issues. I’m not an expert in this area, but understand the perf utility may be able to help here. Perhaps you might be able to compare the two installs and see what the differences are?

I installed linux-tools-4.15.0-34-generic which contains the perf command for my running kernel. Then I had to echo -1 > /proc/sys/kernel/perf_event_paranoid and echo 0 > /proc/sys/kernel/kptr_restrict to temporarily give access to the necessary pieces perf needs.

I ran perf record -a -s -T vscode and then perf report and got a breakdown of where time was spent. Dunno if this is a useful comparison between systems, or whether we can find better tools to do this. Keen to hear feedback.

An expert in this area like @cking might have some better tips :slight_smile:

1 Like

Thanks for your answer. I just tried that but “perf record” stops recording a second after starting. Instead I started vscode shell “snap run --shell vscode” and then “perf record -a -s -T $SNAP/usr/share/code/code”, which recorded the whole startup. I uploaded perf.data
perf.data