Recently canonical advertisement via a blog post which has started to address performance issues with the Firefox Snap package which was offered by default in Ubuntu 22.04 instead of the normal deb package.
The main User dissatisfaction due to slow launch of Firefox. For example, on a Dell XPS 13 laptop, the first launch of Firefox after installation takes 7.6 seconds, on a Thinkpad X240 laptop it takes 15 seconds, and on a Raspberry Pi 400 board it takes 38 seconds. Reboots complete in 0,86, 1,39, and 8,11 seconds, respectively.
Ubuntu Desktop aims to offer an open source operating system, available to everyone, that just works for what they need. With Ubuntu 22.04 LTS, we believe we are closer than ever to achieving that goal. However, as always, there are still a number of areas that we want to improve in order to deliver the highest quality user experience. One of those areas is our default browser, Firefox , which shipped out of the box with Ubuntu 21.10.
To understand this decision, I want to focus on the 'it just works' part of my opening statement. The Firefox plugin offers a number of benefits for everyday users of Ubuntu, as well as a range of other Linux distributions. It improves security, provides compatibility between versions, and shortens the time it takes for Mozilla enhancements to reach users.
During problem analysis, 4 main reasons for slow onset were identified, whose solution will be given the main attention:
- High overhead when searching for files within a compressed squashfs image, which is especially noticeable on low-power systems. It is planned to solve the issue by pooling content to minimize move operations on the image at boot time.
- On Raspberry Pi and systems with AMD GPUs, the long delays were associated with a failure to detect the graphics driver and an alternative to using software rendering with a very slow shader compilation. A patch to resolve the issue has already been added to snapd.
- A lot of time was spent copying the bundled plugins into the user directory. There were 98 language packs built into the instant pack, all of which copied regardless of the language selected.
- There were also delays due to determining all available fonts, icon themes, and font settings.
Running Firefox from the snap package also seen occasional performance issues at runtime, but Ubuntu developers have already prepared workarounds to improve performance.
For example, As of Firefox 100.0, link optimizations over time (LTO) and code-based profiling optimizations (PGO) are enabled in the build. To address messaging issues between Firefox and external subsystems, a new XDG desktop portal has been prepared and support for inclusion in Firefox is being reviewed.
The reasons to promote the snap format for browsers are the desire to simplify maintenance and unify development for the different versions of Ubuntu: The deb package requires separate maintenance for all supported Ubuntu branches and accordingly, compilation and testing taking into account different system versions, components, and the snap package can be built immediately for all Ubuntu branches.
In addition, Mozilla employees maintain the Firefox snap package that is offered in Ubuntu, that is, it is formed first-hand without intermediaries. The snap distribution also sped up the delivery of new versions of the browser to Ubuntu users and allowed Firefox to run in an isolated environment created with the AppArmor mechanism to further protect the rest of the system from exploiting vulnerabilities in the browser.
Finally If you are interested in knowing more about it, you can check the details in the following link