Skip to content
Commit fbb71f9c authored by David Edmundson's avatar David Edmundson
Browse files

XWayland: Don't dispatch xwayland events in QAbstractEventDispatcher sleeps

QAbstractEventDispatcher blocks and waits constantly on every external event
processed; every timer or update from an X or wayland client, mouse
move or DRM event.

Right now every time this happens we go and check Xwayland for new
events, this is a system call (poll) that based on strace will
unsurprisingly immediately return with EAGAIN as there's nothing to read
from X. If there is something to read our socket notifier will fire. On block we do still need to read any events read in the meantime that weren't dispatched.

This cuts down our system calls significantly, which hopefully should have a
noticeable impact on performance especially when the kernel is under
load.

---

Found whilst analysing strace (by accident whilst looking for something else!)

In a simple case of xwayland nested running glxgears we go from 28 calls per frame to 21. With many many clients and more input events it'll be an even higher percentage.
parent d983b781
Pipeline #326486 passed with stage
in 12 minutes and 27 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment