The slow start-up time of newly installed Snap apps has been a point of contention for many Ubuntu Linux users for a while.
But developers behind the fledgling app format have announced that a noticeable improvement in first-run loading times is on the way.
Snap Apps & Slow Startup
Install a graphical Snap app on any Snap-supported Linux distro and you’ll almost certainly witness a slow start-up time the very first time you happen to run it.
Why? Snap developer Igor Ljubuncic writes in a blog post: “In general, with graphical software, [first run] used to take a fair deal of time, causing a delay in application opening, and would impair the user experience.”
“We took this problem seriously, and implemented changes that resolve most of the issues.”
Duly profiling the first-launch start-up time of Microsoft’s open-source text editor VScode (considered a ‘complex’ app) the Snap team was able to hone in on the issue.
And the chief cause? Apparently down to font cache generation on first run.
Font Cache Failure
Yup, no packaging issues, format bugs, or integration woes. Just plan ol’ font-caching.
Graphical Snap apps, like VLC, VSCode, etc, query the font-cache on start-up.
An app will start-up promptly if a valid font-cache is available and accessible. If it isn’t, one has to be generated.
It’s this task that Igor blames for the the slow start-up, continuing:
“[Font cache generation] can take a long time, especially if there is a large number of fonts that needs to be enumerated […] during which the GUI application may not render on the screen, and users will interpret this delay as a slow application startup.”
By leveraging ‘font cache binaries’ in Snapd, the underlying “engine” that powers the Snap system, startup times have been improved by as much as 6x.
Linux users running Snapd 2.36.2 (or later) automatically benefit from this tweak — and it’s not the only fix ’em up on the way.
Font cache fixed, the Snap team says it plans to focus on other areas that affect the performance of Snap apps.
Hopefully that’ll include cold start Snap startup times too!