Martin Stransky, the maintainer of the Firefox packages in Fedora and RHEL, who is involved in porting Firefox for Wayland, published a report reviewing the latest achievements in Firefox's performance in environments based on the Wayland protocol.
Upcoming releases of Firefox are set to address the clipboard issues and pop-up handling observed in the Wayland builds. These features were not implemented immediately due to differences in their implementation approach in X11 and Wayland. In the former case, difficulties arose from the asynchronous operation of the Wayland clipboard, which required the creation of a separate layer to abstract access to the Wayland clipboard. This layer will be added in Firefox 93 and enabled by default in Firefox 94.
Regarding pop-up dialogs, the main challenge was that Wayland enforces a strict hierarchy for pop-up windows, meaning a parent window can create a child window with a pop-up, but any subsequent pop-up generated from this window must be linked to the original child window, forming a chain. In Firefox, each window could generate multiple pop-ups without forming a hierarchy. The problem arose because, with Wayland, closing one of the pop-ups requires rebuilding the entire chain of windows with other pop-ups, while having several open pop-ups is not uncommon, as menus, tooltips, extension dialogs, permission requests, etc., are implemented as pop-ups. The situation was further complicated by shortcomings in Wayland and GTK, where even minor adjustments could lead to various regressions. Nevertheless, the code for handling pop-ups for Wayland has been debugged and is planned to be included in Firefox 94.
Other improvements related to Wayland include the addition in Firefox 93 of changes regarding scaling on screens with different DPI, which eliminated flickering when moving a window to the screen’s edge in multi-monitor configurations. In Firefox 95, issues arising from using the drag & drop interface, such as copying files from external sources to local file systems and moving tabs, are expected to be addressed.
In the release of Firefox 96, the Firefox port for Wayland is planned to reach functional parity with the build for X11, at least when operating in the GNOME environment of Fedora. After this, developers will shift their focus to refining the operation of the GPU process in Wayland, which contains the code for interacting with graphics adapters and protects the main browser process from crashing in case of driver failures. The code for decoding video using VAAPI is also intended to be moved into the GPU process, which is currently running in content processing processes.
Additionally, it is worth noting that a small percentage of users of stable branches of Firefox will have access to the strict site isolation mode developed within the Fission project. Unlike the previously used arbitrary distribution of tab processing across the available pool of processes (default is 8), the strict isolation mode isolates each site into its own separate process, separating not by tabs but by domains (Public Suffix), which allows further isolation of the contents of external scripts and iframe blocks. The management of enabling the Fission mode is controlled through the variable "fission.autostart=true" in about:config or on the about:preferences#experimental page.
The strict isolation mode protects against side-channel attacks, such as those related to Spectre-class vulnerabilities, while reducing memory fragmentation, returning memory to the operating system more efficiently, minimizing the impact of garbage collection and intensive computations on pages in other processes, increasing the efficiency of load distribution across different CPU cores, and improving stability (the crash of the process handling an iframe will not bring down the main site and other tabs).
Among the known issues arising when using strict isolation mode, there is a noticeable increase in memory and file descriptor consumption when opening a large number of tabs, as well as disruptions to the functioning of some add-ons, the loss of iframe content when printing and calling the screenshot function, decreased efficiency of document caching with iframes, and loss of content in filled but unsubmitted forms when restoring a session after a crash.
Among other changes in Firefox, the migration to the Fluent localization system has been completed, the High Contrast Mode has been improved, the ability to record performance profiles of processes in one click has been added to about:processes, and the option to revert to the old style of the new tab page that was used before Firefox 89 has been removed.
Source: opennet.ru
