Canonical has begun addressing performance issues with the Firefox snap package that was offered by default in Ubuntu 22.04 instead of the standard DEB package. The main user complaint is the extremely slow startup time 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 – 15 seconds, and on a Raspberry Pi 400 board – 38 seconds. Repeated launches take 0.86, 1.39, and 8.11 seconds, respectively.
During the analysis of the problem, 4 main reasons for the slow start were identified, the solution of which will be given the main attention:
- High overhead when searching for files inside a compressed squashfs image, which is especially noticeable on low-powered systems. The problem is planned to be solved through the grouping of content to minimize the movement operations in the image during launch.
- On Raspberry Pi and systems with AMD GPUs, large delays were associated with a failure to detect the graphics driver and a fallback to software rendering with very slow shader compilation. A patch to solve the problem has already been added to snapd.
- A lot of time was spent copying the add-ons built into the package into the user's directory. There were 98 language packs built into the snap package, all of which were copied regardless of the selected language.
- Delays also occurred due to the determination of all available fonts, icon themes, and font configurations.
When launching Firefox from snap, there were also some performance issues observed during operation, but the developers Ubuntu Performance improvements have already been prepared. For example, starting with Firefox 100.0, link-time optimizations (LTO) and profile-based optimizations (PGO) are enabled in the build. To address issues with messaging between Firefox and external subsystems, a new XDG Desktop Portal has been prepared, and support for it is currently being reviewed for inclusion in Firefox.
The reasons for promoting the snap format for browsers are the desire to simplify maintenance and unify development for different versions. Ubuntu — the deb package requires separate maintenance for all supported branches Ubuntu and, accordingly, assembly and testing taking into account different versions of system components, and the snap package can be formed for all branches at once UbuntuMoreover, the proposed Ubuntu The Firefox snap package is maintained by Mozilla employees, meaning it is created firsthand, without intermediaries. Delivering it in snap format also speeds up the delivery of new browser versions to users. Ubuntu and made it possible to run Firefox in an isolated environment created using the AppArmor mechanism, for additional protection of the rest of the system from exploitation of vulnerabilities in the browser.
Source: opennet.ru
