Canonical has announced that snapd 2.36.2 onwards users should notice a significant speed improvement by up to two to six times when launching GUI applications. The firm was able to deliver these speed increases by including fontconfig cache binaries within snap, whereas before, the font cache has to be generated, causing a delay.
Snap packages are a fairly modern creation by Canonical; their purpose is to simplify app distribution across different Linux distributions as they’re easier to update and are also more secure thanks to sandboxing. As they’re relatively new (they’ve been around since December 2014), certain issues are still being worked out, and as we can see from this news, optimisations are still being made.
Writing on the issue, Igor Ljubuncic, said:
“To resolve the issue of slow application startups due to font cache generation, starting with snap 2.36.2, fc-cache-v6 and fc-cache-v7 binaries are included in the core snap, and they are used to create fontconfig caches automatically when snaps get installed – at the installation time. This operation eliminates the excessively long startup times that some users have been seeing. With these architectural results in place, the results now portray a different picture. While there is still some time penalty … the difference is much more tolerable.”
Examining the difference after font caching was added to the snap binaries on Ubuntu 18.10, Microsoft’s Visual Studio Code opened in 22.9 seconds, down from 119.9 seconds. That’s still about seven seconds behind the deb package version but still a significant speed boost nonetheless. In future, these speeds will be improved further by sharing libraries from common packages.
If you depend on snap packages be sure to check synaptic or whatever package manager you have to see which version of snapd you have installed. If it’s 2.36.2 or above you will already be benefitting from these optimisations.