How to better benchmark Xorg vs Wayland?

Debian_SuperUser

Active Member
Joined
Mar 18, 2024
Messages
118
Reaction score
30
Credits
1,317
Before when I was on Ubuntu, I used I think it was called x11-perf from the phoronix test suite (Gnome on Xorg and Wayland). The test results tied with each other. In some tests Xorg won and in some Wayland. But the test I think is very old and probably not a good test. Even before that I was mainly using Xorg, because on Ubuntu Gnome, Wayland took more memory bandwidth than Xorg (yes I am this sensitive). But then I slowly moved on to Wayland, and then I did some vague real tests by running actual graphical programs and games, and I think Wayland did noticeably better, even on programs running on XWayland.

Now on Arch, I am using sway (Wayland) but also have i3wm (Xorg) installed as a second source. I tested i3wm vs Sway in a game, and Sway does take a win. And also, Sway does not take that much memory bandwidth as Gnome Wayland on Ubuntu took. It is actually as close as Xorg (i3wm).

First of all, I think Sway is not that optimized, because I am getting a little lower fps than what I was getting on Ubuntu Gnome Wayland. The swaybar also displays the seconds in time, which updates every second, so, any chance that might be a contributing factor?

On Sway, I ran two benchmarks; Furmark 2 (linux version) and memtest_vulkan (stresses the VRAM, and I am on integrated graphics). I was not running both the benchmarks for performance points (the points would pretty much be the same at such low fps on Furmark, and not much difference in memtest_vulkan), but rather the latency and how the display servers would function in a heavy load. On Sway, when running Furmark and getting like 6 fps, not only Furmark and other windows are laggy, but my cursor also experiences huge latency. I already had experienced this when playing a game and when getting less fps, my cursor lags. And when running memtest_vulkan on Sway, there were some stutters for the cursor but the whole display server didn't lag (note that memory bandwidth for both CPU and GPU is maxed out).

On Xorg though, the cursor does not lag at all in Furmark even when getting 6 fps. And the cursor also doesn't stutter in memtest_vulkan. If somebody knows, I would like to know the specific Xorg vs Wayland differences that play here. Does Xorg use a completely separate render thread or something?

Now my memory is very weak, but I vaguely think that this was the opposite on Ubuntu. It lagged on Xorg, and didn't on Wayland. If I believe myself, then it should be correct, or else why would I still use Wayland? But this makes no sense. And I also thought that the higher memory bandwidth usage was just a Wayland thing, but Sway does not have it, and it actually might not be a good thing (heavier but efficient software is better than lighter but in-efficient)?

With that said, i3wm has its own problems which keep me on Sway. Switching between workspaces creates a flashy and jumbled screen for a few frames. I can't even tell if Vsync is on or off, because I kind of see some tearing but I am on a 120Hz screen so that is why I am being confused. But these are the things which might be fixed if I install picom or other Xorg compositors, so maybe no worries. And I remember that when prior when I was on Debian (not Ubuntu), it used the older Intel Xorg driver by default rather than the modesetting driver, and vsync was definitely not there without picom, and the modesetting driver itself did not include tear-free option, but the older Xorg driver did, and hence picom was needed for compositor level vsync.

But I forgot to ask the main question. What benchmarks can I use to more deeply and accurately benchmark Xorg vs Wayland, and additionally, if there is a fix for the latency issue on Sway.
 


If you want good FPS then you want the following things updated to the max:

  • WineHQ-staging
  • GPU driver
  • BIOS
  • Kernel
  • Lutris (if you use it)
  • Vulkan
  • dxvk
  • vkd3d

xorg vs wayland IMO doesn't make any influence on games because games have their own rendering engine and don't use window managers like regular programs.
 
Have you looked at glmark2, it's in most distro's.
 
If you want good FPS then you want the following things updated to the max:
Nah, not really helpful. And I have them updated (for those needed).

xorg vs wayland IMO doesn't make any influence on games because games have their own rendering engine and don't use window managers like regular programs.
It does. I have done the experimentation. Yes, games have their own rendering engine, but the display server plays a role in handling a lot of the backend stuff (like GPU calls and using the driver), and it does make a difference.

Have you looked at glmark2, it's in most distro's.
By benchmarks, I didn't mean just some normal programs which render graphics. If so, I have already run games and proved Wayland sort of superior. But benchmarks which stress the display server itself by instructions specifically optimized (or unoptimized for that matter) for putting load on the software stack itself. X11-perf from the Phoronix test suite as I mentioned is probably the one that does this, but again, its probably very old and inefficient. I would try searching for another in the test suite.
 
It does. I have done the experimentation. Yes, games have their own rendering engine, but the display server plays a role in handling a lot of the backend stuff (like GPU calls and using the driver), and it does make a difference.
Game engines use 3D libraries which communicate with GPU driver directly so I have no idea how you come to that conclusion.

Nah, not really helpful. And I have them updated (for those needed).
Then please share output of inxi -Fxxz and also share which game you're having problem with.
 
I have no idea how you come to that conclusion.
Idk about you but fps numbers are just a bit lower for me on Xorg and I have conformed this. Even when running the games in full screen.
Then please share output of inxi -Fxxz and also share which game you're having problem with.
That's a lot of information. I think the graphics section is the important one
Graphics:
Device-1: Intel UHD Graphics 620 vendor: Hewlett-Packard driver: i915
v: kernel arch: Gen-9.5 ports: active: eDP-1 empty: DP-1, DP-2, HDMI-A-1,
HDMI-A-2 bus-ID: 00:02.0 chip-ID: 8086:5917
Device-2: Quanta HP HD Camera driver: uvcvideo type: USB rev: 2.0
speed: 480 Mb/s lanes: 1 bus-ID: 1-9:5 chip-ID: 0408:5411
Display: wayland server: X.org v: 1.21.1.13 with: Xwayland v: 24.1.2
compositor: Sway v: 1.9 driver: X: loaded: modesetting unloaded: vesa
alternate: fbdev,intel dri: iris gpu: i915 display-ID: 1
Monitor-1: eDP-1 model: InfoVision Optronics/Kunshan 0x057f res: 1920x1080
dpi: 158 diag: 355mm (14")
API: Vulkan v: 1.3.279 surfaces: xcb,xlib,wayland device: 0
type: integrated-gpu driver: mesa intel device-ID: 8086:5917
API: EGL Message: EGL data requires eglinfo. Check --recommends.
 
Game engines use 3D libraries which communicate with GPU driver directly so I have no idea how you come to that conclusion
They do access the GPU to request the calculations and the rendering processes, but the representation of the graphics on the screen goes always through the display manager, no matter what.

Think that in most of the games you have the ability to represent them in a window, and they run within a Display Manager session. Also, the display manager coordinates the input as well so that you don't have 2 mouse cursors showing at once in the screen following each other at a distance (that happens for example with GCompris which, I believe, is an SDL application).

Apparently the mileage may vary between X11 and Wayland and would mostly depend on your specific hardware. Some emulation libraries like Wine and Proton are written for X11, and theoretically would work better on it; however, Wayland is more resource efficient and some graphics drivers will work better on Wayland even if you need to have the XWayland layer.
 
Any "benchmark" suggestions that can beat hardInfo in terms of relative widespread universality?
 
They do access the GPU to request the calculations and the rendering processes, but the representation of the graphics on the screen goes always through the display manager, no matter what.

Think that in most of the games you have the ability to represent them in a window, and they run within a Display Manager session. Also, the display manager coordinates the input as well so that you don't have 2 mouse cursors showing at once in the screen following each other at a distance (that happens for example with GCompris which, I believe, is an SDL application).

Apparently the mileage may vary between X11 and Wayland and would mostly depend on your specific hardware. Some emulation libraries like Wine and Proton are written for X11, and theoretically would work better on it; however, Wayland is more resource efficient and some graphics drivers will work better on Wayland even if you need to have the XWayland layer.
It makes sense, thanks for correction!
 

Members online


Latest posts

Top