Composite redraw speedup?

Adam Jackson ajax at nwnk.net
Tue Feb 11 22:41:21 UTC 2020


On Sat, 2020-02-08 at 15:46 +0100, Egil Möller wrote:
> Hi!
> 
> I have for a time now been working on a new composing window manager
> to try
> out a few UX ideas (https://redhog.github.io/InfiniteGlass videos: 
> https://www.youtube.com/watch?v=vbt7qtwiLiM 
> https://www.youtube.com/watch?v=E8f2KwgvxK4).
> 
> However, I'm having a performance problem in my redraw loop: When a
> lot is going on, e.g. during continuous stream of mouse events and/or
> PropertyNotify events + property gets, DamageNotify events for
> windows are often queued up and e.g. animations or video appear
> choppy.

So this bit of the main loop jumps out at me:

    while (XPending(display)) {
      XNextEvent(display, &e);
      mainloop_event_handle(&e);
      XSync(display, False);
    }

https://github.com/redhog/InfiniteGlass/blob/master/glass-renderer/mainloop.c#L99

This isn't doing yourself any favors. XSync is a synchronous round-trip 
to the server, and on my laptop you get about 80,000 of those a second.
You're doing one of these for every event, and you really shouldn't
need to. What happens if you remove just that call to XSync?

- ajax



More information about the xorg-devel mailing list