Performance comparison of KDE Plasma sessions based on X11 and Wayland

Igor Ljubuncic, who until 2024 was responsible for high-performance computing products at Canonical, conducted performance and energy consumption testing of the KDE Plasma 6.4 sessions based on X11 and Wayland. At the end of June, Igor published a review of the capabilities of KDE Plasma 6.4, concluding that the Wayland-based session performs worse and puts a greater load on the CPU and GPU than the X11-based session. In a series of new articles, Igor attempted to delve deeper into the performance testing of both sessions.

It was initially noted that when testing on a Lenovo IdeaPad 3 laptop with an integrated AMD GPU, the Wayland session consistently placed a load on the CPU of about 8% regardless of CPU activity, and every 2-3 seconds, a spike fully loads the GPU. In the X11 session, the load on the CPU and GPU was zero during idle time. Further verification with the radeontop utility showed greater resource consumption in the Wayland session, especially when activating the 'Color Accuracy' profile in the display settings. The table below indicates the average load on the GPU in percentages for a similar set of applications running and data collection every second for 60 seconds.

Metric Wayland + power efficiency Wayland + color accuracy X11 Graphics pipe 3.31 4.03 2.47 Vertex Grouper + Tesselator 0.33 0.3 0.11 Texture Addresser 0.90 2.03 0.78 Shader Export 2.24 3.03 1.42 Sequencer Instruction Cache 0.06 0.08 0.03 Shader Interpolator 2.58 3.31 1.61 Scan Converter 2.54 3.18 1.54 Primitive Assembly 0.32 0.30 0.11 Depth Block 2.51 3.18 1.53 Color Block 2.51 3.18 1.54 VRAM 26.39 28.44 22.36 GTT 3.92 3.98 3.85 Memory Clock 33.33 54.90 54.81 Shader Clock 16.67 16.67 16.67

Testing the energy consumption with the powertop utility also showed an advantage for the X11 session: the energy consumption of the Wayland session during several measurements was 6.09 watts, Wayland with the 'Color Accuracy' profile was 6.05-6.08 watts, while X11 was 5.67-5.87 watts. Overall, it was concluded that the X11 session consumes 3-7% less battery charge than Wayland.

The CPU load check using the vmstat utility showed that during idle time, the X11 session consumed 1.83% CPU, while Wayland used 1.97% (2.1% with the Color Accuracy profile). The utility was run on freshly created sessions in the Konsole terminal, averaging values with a sampling rate every second over 60 seconds. The CPU load when using Wayland was 7.6% higher (14% in Color Accuracy mode) than that of the X11 session. The Wayland session recorded 25% more interrupts and 48% more context switches.

Metric Wayland + power efficiency Wayland + color accuracy X11 Average no. of tasks in the runqueue 0.18 0.35 0.07 Total tasks in the runqueue 11 21 4 Interrupts (in) 1188 1173 937 Context switches (cs) 1195 1208 803 Idle CPU % (id) 98.03 97.90 98.17

Next, an analysis of calls during idle time was performed with the perf utility. KWin_wayland consumed about 1% (1.5%) of CPU time, while KWin_X11 consumed 0.44%. Calls to amdgpu accounted for 0.77% (1%) for Wayland and 0.65% for X11. During idle time, the X11 session executed about half as many CPU instructions as the Wayland-based session.

Metric Wayland + power efficiency Wayland + color accuracy X11 CPU clock (ms) ~543,000 ~540,000 ~527,000 Context switches 14,415 | 26.547/s 16,120 | 29.864/s 6,021 | 11.436/s CPU migrations 72 | 0.133/s 139 | 0.258/s 92 | 0.175/s Page faults 201 | 0.37/s 450 | 0.834/s 75 | 0.142/s Cycles 3.95B | 0.007 GHz 4.43B | 0.008 GHz 1.9B | 0.004 GHz Stalled cycles frontend 452.5M | 11.47% 616.5M | 13.92% 213M | 11.13% Stalled cycles backend 1.42B | 36.04% 1.45B | 32.82% 618M | 32.28% Instructions 780M | 0.2/cycle 1.82 stalled/cycle 901M | 0.2/cycle 1.61 stalled/cycle 483M | 0.25/cycle 1.28 stalled/cycle Branches 168M | 309K/s 193M | 358K/s 104M | 197K/s Branch misses 13.83% 13.36% 11.7%

In the next article, the tests were repeated in a configuration using Kubuntu 24.04 with KDE Plasma 5.27 on a Lenovo Y50-70 laptop with Intel CPU and NVIDIA graphics. The results were roughly the same β€” the Wayland session proved to be less efficient than X11. Power consumption was 22.42 watts in Wayland and 21.86 in X11, CPU load during idle time was 0.067 versus 0.050, context switches numbered 43.835/s compared to 34.133/s, and the load while playing 4K video in VLC was 12.54% versus 4.26%, with WebGL performance measuring 16 FPS against 29 FPS.

Subsequent similar tests were conducted on a Lenovo IdeaPad 3 laptop with AMD CPU/GPU using a fresh build from the KDE Neon project. In the 4K video playback test in VLC, the CPU load using X11 with compositing off was 3.72%, and with compositing on it was 9.8%. For Wayland with Color Accuracy (CA), the load was 25.71%, and in energy-efficient mode (PE), it was 31.51%. Thus, the CPU load with Wayland turned out to be 8-10 times higher than with X11.

Using Wayland also recorded a 5-16% higher generation of interrupts. The difference in GPU load was within 2%: Wayland (PE) β€” 56.33%, Wayland (CA) β€” 57.33%, X11 (Comp ON) β€” 57.98%, X11 (Comp OFF) β€” 56.81%. In terms of energy consumption, Wayland consumed more power by 8-49%: 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, results for Wayland and X11 were about 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 with Wayland was approximately 8% higher.

Ultimately, another experiment was conducted, this time encompassing GNOME from Fedora 42 and KDE Plasma 6.4 or KDE Neon. The testing was performed on a Lenovo IdeaPad 3 laptop with AMD CPU/GPU.

  • CPU load at idle: KDE X11 β€” 1.83%, KDE Wayland (PE) β€” 1.97%, KDE Wayland (CA) β€” 2.1%, GNOME Wayland β€” 2.2%.
  • Energy consumption at idle 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.
  • The GPU load at idle was lowest in the configuration with GNOME Wayland, but the difference is explained by the variation in the applications running: 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 test for 4K 60FPS video playback in VLC, the GNOME session in Fedora consumed slightly less CPU (29.6%) than KDE based on Wayland in Color Accuracy mode (31.51%), but more than the KDE session on X11 (9.8%) and Wayland in energy-efficient mode (25.71%).
  • When assessing GPU resource consumption, the GNOME session in Fedora during a 4K 60FPS video playback test consumed more GPU resources. For instance, the load on the GPU graphics pipeline in GNOME in Fedora was 58.21%, in KDE based on Wayland it was 56.33% and 57.33%, while in KDE X11 it reached 57.98%. Video memory consumption in GNOME in Fedora was over twice that of KDE based on Wayland (50.89 against 23.29 and 24.60) and exceeded KDE X11 by 15% (44.36).
  • Power consumption during video playback: 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.

Metric Fedora 42 Wayland KDE neon Wayland (PE) KDE neon Wayland (CA) KDE neon X11 (Comp ON) Idle CPU % (id) 97.8 98.03 97.90 98.17 Context switches (cs) 536 1195 1208 803 Number of interrupts (in) 929 1188 1173 937 Power consumption (watts) 5.83-7.62 6.09 6.05-6.08 5.67-5.87 CPU clock (ms) ~492,000 ~543,000 ~540,000 ~527,000 Context switches 9,468 | 19.244/s 14,415 | 26.547/s 16,120 | 29.864/s 6,021 | 11.436/s Idle CPU % during video playback 70.4 68.49 74.29 90.20 GPU graphics pipeline load during video playback 58.21% 56.33% 57.33% 57.98% VRAM 50.89 23.29 24.60 44.36 Energy consumption in watts during video playback 12.5-15.6 13.8-20.4 13.8-14.1 11.4-14.9 FPS in the WebGL Aquarium test 26-29 16-38 18-37 16-42 Energy consumption in the WebGL Aquarium test 17-19 17-29 16-27 21-29

The test results indicate that it is too early to dismiss X11, while solutions based on Wayland require further optimization. X11 is still noted as the most optimal solution in terms of performance. The Wayland implementation in KDE is reportedly better than in GNOME β€” the GNOME Wayland session implemented in Fedora appears to be less efficient than the KDE Wayland session, which in turn lags behind KDE X11.

Source: opennet.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers πŸ”₯ Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster