[Xcb] XPutImage and context switches / roundtrips?

Ian Osgood iano at quirkster.com
Wed Sep 10 13:43:49 PDT 2008


On Sep 10, 2008, at 1:21 PM, Clemens Eisserer wrote:

> Hi,
>
> Sorry for the additional traffic.
> Running a benchmark testing the scenario described earlier my system
> (with a dual-core CPU) does 10.000 context switches per second, which
> clearly related with the amount of 32x32x8 tiles I send down using
> XPutImage.
> So it seems the flush in this case does trigger a context switch.
>
> Is there anything that can be done against this?
> Maybe increasing the buffer to something like 32kB, I guess this size
> would be perfect for my use-case - but I have read somewhere that the
> size is fixed to 4kb and can not be chaged at run-time, not even at
> compile-time (which would be useless for me anyway).
> Could the BigRequest extension used for this?
>
> Thank you in advance, Clemens

Depending on how often your small images change, you might be able to  
register them as background images with a GC once and draw them  
repeatedly that way.  For example, look at the implementation of the  
xcb/demo/xcbneko.

This is a general X optimization question, so you might pose it to  
the main xorg list as well. Does anyone else know of any books or  
articles on general X application optimization?

Ian



More information about the Xcb mailing list