Linux Browsers - X11 vs Wayland


(Updated June 8th, 2023)

Firefox, on Gnome, runs through the XWayland layer by default. This causes issues if you want to use screen scaling, as everything will look blurred. You can fix it by forcing native Wayland which, by the way, also enables better support for touchscreens. Double win.

I also recommend switching to a Wayland compositor for modesetting drivers, as some experience vertical tearing on Xorg but not on Wayland.

TLDR

To enable native Wayland on Firefox, put the MOZ_ENABLE_WAYLAND=1 flag on the desktop launcher or before "firefox" on the command line.

For Google Chrome, open "chrome://flags" and change "Native Ozone Platform" to Wayland or Auto.

System Setup

Acer Laptop SP111-31. It is a very old, slow system, where there is more variation between browsers.

For 2022, it was the same system running on the Celeron N3350. Starting with 2024, I upgraded to a quad core N3450, which has two more cores and 200MHz less of boost.

Software

The OS used was Mint 20 in 2022, which was updated to 21.2 in 2024. Because of this, there may be kernel and library related changes that have some performance implications for these benchmarks. Nevertheless, I think it is better to have a suite that is more representative of current performance than not.

What has become apparent is that current performance on this machine, in June 2023, has increased substantially at least for Speedometer 2.0.

I have refrained to move to Speedometer 2.1 as it is faster. I may restart the benchmarking at a later time on that version. Speedometer 3.0 is too slow to run on this particular hardware.

I have also changed the CPUFreq scheduler to 'ondemand', as the default 'schedutil' has always been noticeably slower for me, accross a range of hardware.

Browser support

Edge does not support native Wayland at this time, while Chrome does. Edge on Linux is till a work-in-progress.
Firefox supports both and now enables Wayland when running under a compatible compositor.

Speedometer 2.0 tests

With this I also decided to test performance on the new display server protocol, compared to Xorg. The browser benchmark of choice, has been Speedometer.

Results - N3450:

Chrome  130 (X11)      - 48.10 / 48.96 (max)
Chrome  129 (X11)      - 47.39
Firefox 131 (X11)      - 40.75

Results - N3350  (2022):

Chrome 114 (Wayland)   - 40.40 / 1.00%
Chrome 114 (XWayland)  - 41.10 / 0.67%
Chrome  95 (X11/XFCE)  - 33.20 / 1.00%

Chrome  ?? (X11/XFCE)  - 35.30
Chrome  ?? (XWayland)  - 36.80
-----
Edge    95 (XWayland)  - 24.50 / 0.60%
Edge   114 (XWayland)  - 29.00 / 1.20%
-----
Firefox  93            - 23.90
Firefox (XFCE)         - 25.27
Firefox (XWayland)     - 25.13
Firefox (Wayland)      - 27.78

Conclusion

Definitely better performance, even for Chrome running over XWayland. On Firefox only native improves results and, as usual, trails Chrome quite a bit in benchmarks. More recent hardware sometimes is more up to speed with Chrome/Edge and Windows performance is different than Linux. IIRC, Chrome is slower on Windows vs Linux, Firefox is faster.

For this machine, I have been opting to use Firefox because of support for VA-API video acceleration and for some reason Chrome lags a lot while switching tabs or opening new ones.

Have you tried it, what are your thoughts?

No comments:

Post a Comment