Why are some snaps fast, and others so slow?

This is not a direct answer as it isn't a way to speed up snaps, but it may help anyway.

Spotify is available as a .deb which you can install in Ubuntu instead of using the snap.

I tested both options on my system and got the following approximate results:

Snap -> 7.5 seconds

Apt -> 0.5 seconds

Which raises another point. You mentioned in a comment that you're running on a 2.5gb/s NVME SSD which suggests to me you have a fairly modern PC. I'm running something similar but I can load Spotify as a snap in 7.5 seconds compared to your 43 seconds. Perhaps you have some other issue on your system. 43 seconds does seem excessively slow on a modern PC, even for a snap.


You are correct: Some toolkits offer high compatibility, but at a price in performance.

As a user, there is nothing you can do about it at runtime. Snapd does not have a secret Turbo setting, sorry.

File a bug or issue with the snap author.

Skilled users can help: Historically, packaging has been a community volunteer role, not a developer chore. Developers sometimes choose electron and other toolkits when they want to distribute, but lack enough community members to help them package for multiple platforms. In other words, if you get involved, you can make a difference. You can make it better.


Snap packagers need to opt in to include lzo compression so that it's not using the slower xz compression when they're installed on your system:

  • https://ubuntu.com/blog/snap-speed-improvements-with-new-compression-algorithm
  • https://snapcraft.io/blog/why-lzo-was-chosen-as-the-new-compression-method
  • https://forum.snapcraft.io/t/how-to-switch-your-snap-to-use-lzo-compression/21714

Spotify is one of the worst cases of this and they probably should turn it on. In certain cases, like Chromium, the difference was significant and now it launches fast once that change was committed by the packagers.

Tags:

Snap