HN
Today

Measuring Input Latency on Linux: X11 vs. Wayland, VRR, and DXVK

This meticulous study tackles the hotly debated topic of input latency in Linux gaming, comparing X11, Wayland, VRR, and specialized DXVK forks with a custom-built measurement device. It provides concrete, data-backed answers to common performance folklore, revealing that XWayland is the true latency culprit, not native Wayland itself. Hacker News appreciates the scientific rigor applied to a topic often dominated by anecdotal evidence and 'feelings'.

81
Score
20
Comments
#1
Highest Rank
4h
on Front Page
First Seen
Jul 14, 5:00 PM
Last Seen
Jul 14, 8:00 PM
Rank Over Time
1118

The Lowdown

Driven by the pervasive, yet unverified, advice on optimizing Linux for gaming, the author embarked on a side project to objectively measure end-to-end input latency. Using a custom-built 'click-to-photon' device—a photodiode-equipped microcontroller simulating mouse clicks and detecting screen changes—they sought to validate claims about X11 vs. Wayland, Variable Refresh Rate (VRR), and a low-latency DXVK fork.

The testing, conducted on a high-refresh-rate monitor using Diabotical, yielded several significant findings:

  • XWayland is the primary latency adder: It introduced a substantial 3.13 ms of latency, more than all other measured effects combined, largely explaining the common perception of Wayland being 'slow' when running X11 applications through XWayland.
  • Native Wayland is nearly on par with X11: When running natively, Wayland showed only a marginal 0.14 to 0.22 ms higher latency than X11, challenging the widespread belief that Wayland inherently suffers from much worse input lag.
  • VRR significantly reduces latency and jitter: Enabling VRR (G-Sync/FreeSync) consistently improved latency by 0.26 to 0.45 ms and notably flattened the latency distribution, making frame delivery more consistent.
  • dxvk-low-latency offers clear benefits: This specialized DXVK fork provided a small but consistent 0.10 to 0.29 ms improvement in capped scenarios. Its true strength emerged in uncapped tests, where it reduced latency by 0.84 ms and also recovered a remarkable 2.1 ms in XWayland scenarios, smoothing out frame pacing and preventing render-queue buildup.

While the absolute latency figures are specific to the author's hardware and software, the relative performance gains and losses observed are expected to translate across different setups. This systematic approach provides valuable, quantifiable insights into Linux gaming performance, moving beyond subjective 'feel' to empirical data.

The Gossip

Wayland Woes and Wows

The findings regarding X11 vs. Wayland sparked significant discussion. Many commenters, like 'cgyvbunji', suggested that the article's debunking of Wayland's perceived slowness actually confirmed that XWayland was the real culprit behind poor performance. Others, such as 'seba_dos1' and 'superkuh', pointed out the critical nuance that 'Wayland' isn't a monolithic entity; different compositors (like KDE Plasma vs. Hyprland) can have vastly different latency characteristics. Despite the technicalities, some users like 'datakan' expressed fatigue with the perennial X11 vs. Wayland debate, equating it to other long-standing Linux flamewars.

Linux Latency Lust

Hacker News users celebrated the rigorous, data-driven approach to a topic often dominated by anecdotal evidence. Commenters expressed excitement about the ability to objectively measure and improve Linux's performance, particularly in gaming. Many shared their own experiences switching to Linux for gaming, noting perceived snappiness (like 'prhn' and 'NelsonMinar') and appreciating the 'tinkerability' of the Linux ecosystem. There was also discussion about the impact of hardware choices, with 'shmerl' advocating for AMD GPUs and 'bigyabai' defending Nvidia's viability on Wayland despite some performance hits.

Methodology Musings

While generally praising the article's methodology, some commenters raised questions about the generalizability of the results. 'modeless' pondered how the findings might differ on more common 60Hz monitors or with non-3D applications, as the tests were conducted on a 500Hz display with a specific game. 'hs86' questioned the common competitive gaming practice of targeting frame rates far exceeding display refresh rates, suggesting it might be a placebo effect, and how it relates to console gaming's different optimization strategies.