20

Straight from cold Fossa boot, until usable user interface:

Blender 2.91.2: 4 seconds

Gimp: 11 seconds

Boxy SVG: 22 seconds

Spotify: 43 seconds

The latter two seem like electron apps and take forever. Since these electron apps seem to be increasingly common, is there a way to speed up their snap load times? Spotify in particular is egregious.

2
  • An alternative to snap that doesn't suffer from the slow startup is Flatpak. flathub.org/home
    – rtclark
    Commented Feb 23, 2021 at 16:50
  • Spotify is not an Electron app and Boxy SVG is Commented Feb 23, 2021 at 17:27

5 Answers 5

19

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.

6
  • 1
    I'm running ZFS on root partition which might not be in a happy marriage with Snap. Dunno. Commented Feb 23, 2021 at 22:09
  • @ThomasBrowne, is your processor slow?
    – france1
    Commented May 11, 2023 at 13:21
  • @france1 8/16 Core Ryzen first gen. So not the fastest but defo not slow, also 64GB or RAM, and fast Samsung 1TB ssd with plenty of free space. So no. The hardware is fine. Commented May 24, 2023 at 9:03
  • 1
    @ThomasBrowne the first generation has a maximal boost frequency of 3.7GHz. I myself don't have such problems with snaps and my processor goes up to 4.7GHz. I think Spotify is still using the slow compressor, but it launches within 0.5 seconds on my system. I've just installed it to test.
    – france1
    Commented May 24, 2023 at 12:46
  • @france1 I suspect that this problem has been fixed by Canonical. I started using snaps early. Question is from more than 2 years ago and lots of people were complaining. Anyway I'm all in on Nix now buh-bye Snaps, Flatpak etc and good riddance. Commented May 29, 2023 at 13:47
9

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:

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.

7

You are correct: Some cross-platform application development toolkits --like Electron or Mono-- can offer high compatibility, but also can cost a price in performance. As a user, there is nothing you can do about it at runtime.

An application packaged using Snapd should not run noticeably faster or slower slower than the same application packaged another way. If you can reliably reproduce a significant difference, then please file a bug or issue with the snap author, AND please raise the issue in the forum at snapcraft.io.

0
2

I think the most simple answer is a bigger package will take more time to start than smaller ones, Spotify is based on electron which (I think) is essentially translating a web app into a package/app which is convenient for companies because they don't need to hire more developers to work on another version of the software but the other hand, it's taking too many resources, we can only hope that developers and companies make more effort into making their apps (especially paid ones), I'd recommend on upgrading to an SSD for better performance system-wide.

3
  • 3
    thanks yes makes sense, but this is already running of a 2.5G per second NVME SSD. Also Electron apps via apt are at least 3x faster. Still slow but much faster than snap. Commented Feb 22, 2021 at 22:06
  • "convenient for companies because they don't need to hire more developers to work on another version of the software" - makese sense for small to medium sized companies, but doesn't make much sense for e.g. Spotify which is currently worth $66bn. A few extra developers is pocket change. On the other hand, it's hard to think of another plausible reason. Commented Feb 23, 2021 at 9:26
  • 1
    @JonBentley Yeah, the emphasis is somewhat off on that sentence. Electron is a platform for building applications, and developers use it for the same reason they use any other library or toolkit: to avoid having to reinvent parts they're not interested in innovating. Spotify could build an entire UI library which interfaced directly to your graphics card, but nobody would really notice, so they spend their resources elsewhere.
    – IMSoP
    Commented Feb 23, 2021 at 9:30
-1

I can confirm that Atom and Slack Snaps are slow to launch. After replacing Slack Snap with a .deb package the app launches very fast.

I suspect both are Electron packages. The reason Electron app launches take extra time has to do with its architecture. Electron uses Node.js and Chromium as backend/frontend. When you launch an app it has to build this runtime environment first which takes time.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .