Composite redraw speedup?

Egil Möller egil at innovationgarage.no
Wed Feb 12 09:28:55 UTC 2020


On 11.02.2020 23:41, Adam Jackson wrote:
> 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
>
You are right, that should probably just be a flush (if anything at
all), not a full sync. I'll do a test without  it and see what breaks
and what the performance is like.

However, for every PropertyNotify event, I still do a full round trip
with XGetWindowProperty, with every XI_RawMotion I do XQueryPointer and
with every XDamageNotify I do
XCompositeNameWindowPixmap/glXCreatePixmap/glXBindTexImageEXT... It
seems to me it's the multiplexing of these three categories that are
causing problems for me...

/Egil



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.x.org/archives/xorg-devel/attachments/20200212/d61c8be5/attachment.sig>


More information about the xorg-devel mailing list