Igor Ljubuncic, who was responsible for high-performance computing products at Canonical until 2024, tested the performance and power consumption of KDE Plasma 6.4 sessions based on X11 and Wayland. In late June, Igor published a review of KDE Plasma 6.4 features, in which he concluded that the Wayland session is inferior in performance and loads the CPU and GPU more than the X11 session. In a series of new articles, Igor tried to test the performance of both sessions in more depth.
Initially, it was noted that when testing on a Lenovo IdeaPad 3 laptop with an integrated AMD GPU in a Wayland session, regardless of activity, the CPU is constantly loaded by about 8%, and every 2-3 seconds there is a jump that fully loads the GPU. In an X11 session, the load on the CPU and GPU during idle was zero. Further testing with the radeontop utility showed greater resource consumption in the Wayland session, especially when the Color Accuracy profile is enabled in the display settings. The table below shows the average GPU load generated in percent with a similar set of running applications and collecting data every second for 60 seconds.
Power consumption testing with the powertop utility also showed the advantage of the X11 session: the power consumption of the Wayland session when performing several samples was 6.09 watts, Wayland with the Color Accuracy profile was 6.05-6.08 watts, and X11 was 5.67-5.87 watts. Overall, it was concluded that the X11 session consumes 3-7% less battery than Wayland.
Checking CPU load with vmstat showed that during idle, the X11 session consumed 1.83% CPU, while Wayland consumed 1.97% (2.1% with the Color Accuracy profile). The utility was run on freshly created Konsole sessions, and the average value was calculated with a sample every second for 60 seconds. The CPU load for Wayland was 7.6% higher (in Color Accuracy mode it was 14%) than for the X11 session. The Wayland session recorded 25% more interrupts and 48% more context switches.
Next, the perf utility was used to analyze calls during idle time. KWin_wayland consumed approximately 1% (1.5%) of the processor time, and KWin_X11 consumed 0.44%. Calls to amdgpu were 0.77% (1%) for Wayland and 0.65% for X11. In idle mode, the X11 session executed approximately twice as few processor instructions as the Wayland-based session.
In the next article, the tests were repeated in the c K configuration.ubuntu 24.04 with KDE Plasma 5.27 and a Lenovo Y50-70 laptop with an Intel CPU and NVIDIA graphics card. The results were roughly the same: the Wayland session was less efficient than X11. Power consumption was 22.42 watts in Wayland and 21.86 watts in X11, CPU load at idle was 0.067 versus 0.050, the number of context switches was 43.835/s versus 34.133/s, the load when viewing 4K video in VLC was 12.54% versus 4.26%, and WebGL performance was 16 FPS versus 29 FPS.
Further similar tests were reproduced on a Lenovo IdeaPad 3 laptop with an AMD CPU/GPU using a fresh build from the KDE Neon project. In the test with 4K video playback in VLC, the CPU load when using X11 with compositing disabled was 3.72%, X11 with compositing enabled - 9.8%, Wayland with Color Accuracy (CA) - 25.71%, Wayland in power efficiency mode (PE) - 31.51%. Thus, the CPU load when using Walyand was 8-10 times higher than when using X11.
When using Walyand, 5-16% more interrupts were generated. The difference in GPU load was within 2% differences: Wayland (PE) — 56.33%, Wayland (CA) — 57.33%, X11 (Comp ON) — 57.98%, X11 (Comp OFF) — 56.81%. In terms of power consumption, Wayland consumed 8-49% more energy: Wayland (PE) — 13.8-20.4 watts, Wayland (CA) -13.8-14.1 watts, X11 (Comp ON) — 10.7-12.1 watts, X11 (Comp OFF) — 11.4-14.9 watts. In the WebGL Aquarium test, the results for Wayland and X11 were approximately the same: Wayland (PE) - 16-38 FPS, Wayland (CA) - 18-37 FPS, X11 (Comp ON) - 16-42 FPS, X11 (Comp OFF) - 21-42 FPS, but energy consumption when using Wayland was higher by about 8%.
Finally, another experiment was conducted, this time covering GNOME from Fedora 42 and KDE Plasma 6.4 or KDE neon. Testing was done on a Lenovo IdeaPad 3 laptop with AMD CPU/GPU.
- Idle CPU load: KDE X11 - 1.83%, KDE Wayland (PE) - 1.97%, KDE Wayland (CA) - 2.1%, GNOME Wayland - 2.2%.
- Idle power consumption with one terminal window: KDE X11 - 5.67-5.87 watts, KDE Wayland (CA) - 6.05-6.08 watts, KDE Wayland (PE) - 6.09 watts, GNOME Wayland - 5.83-7.62 watts.
- GPU load at idle was lowest in the GNOME Wayland configuration, but the difference is explained by the difference in running applications System Monitor and GNOME System Monitor.
- In the statistics collected by the perf utility, the least CPU time was spent in the GNOME-based configuration.
- In the 4K 60FPS video playback test in VLC, the GNOME session in Fedora consumed slightly less CPU (29.6%) than Wayland-based KDE in Color Accuracy mode (31.51%), but more than the X11-based KDE session (9.8%) and Wayland in power-efficient mode (25.71%).
- When evaluating GPU resource consumption, the GNOME session on Fedora consumed more GPU resources in the 4K 60FPS video playback test in VLC. For example, the GPU graphics pipeline load in GNOME on Fedora was 58.21%, in Wayland-based KDE it was 56.33% and 57.33%, and in KDE X11 it was 57.98%. Video memory consumption in GNOME on Fedora was more than twice as high (50.89) as in Wayland-based KDE (23.29 and 24.60), and 15% higher than in KDE X11 (44.36).
- Power consumption when playing video: KDE X11 - 11.4-14.9 watts, KDE Wayland (CA) - 13.8-14.1 watts, GNOME Wayland - 12.5-15.6 watts, KDE Wayland (PE) - 13.8-20.4 watts.
The results of the tests show that it is too early to write off X11, and Wayland-based solutions require additional optimization. X11 is still noted as the most optimal solution in terms of performance. The implementation of Wayland in KDE is supposedly better than in GNOME - the GNOME Wayland session implemented in Fedora, judging by the tests, is less productive than the KDE Wayland session, which in turn lags behind KDE X11.
Source: opennet.ru
