Why Ubuntu 22.04 is so fast (and how to make it faster)

@raxelgrande,

Triple buffering applies to both Xorg and Wayland. In fact it was working on Xorg about a year earlier than Wayland, and then the remaining year was spent fixing the Wayland issues.

Prior to triple buffering (e.g. Ubuntu 20.04) I would expect Xorg to perform better than Wayland because being a separate process grants it some of the asynchronous benefits of triple buffering. After triple buffering (Ubuntu 22.04 and later) I expect Wayland should perform better as the asynchronicity is about the same but there is no round trip between two different display server processes on every frame. So that’s the first area where Xorg is slower.

Here’s a list of reasons why Xorg might perform worse:

  • Extra round trip between the gnome-shell and Xorg processes on every frame.
  • Xorg drivers mostly can’t handle multi-monitors well and may stutter (LP#1820832).
  • Multi-GPUs: This logic is very different between Xorg and Wayland. Mostly I expect Wayland to be slower (tracking in mutter#2315) but it’s theoretically possible that the Xorg driver you have is less efficient at this than mutter’s Wayland implementation. This is an issue that many laptop owners will hit unknowingly when they plug in a monitor and that port is wired to a discrete GPU.
  • The Xorg driver fails to provide 3 or 4 framebuffers. That would cause serious stutter (or crashes) but I have not seen it happen on desktop drivers yet.
4 Likes