[Xcb] XPutImage and context switches / roundtrips?

Barton C Massey bart at cs.pdx.edu
Wed Sep 10 14:11:33 PDT 2008

In message <194f62550809101140l689a788r5dfa0edfa7983738 at mail.gmail.com> you wrote:
> My application frequently needs to put 8-bit pixmaps
> (XPutImage) with a size of 32x32 or less, so I guess the
> average size is about 500-750byte.
> I've heard that XCB's buffer is fixed at 4kb, so does that
> mean every 5-10 puts a flush is needed?  If so, does that
> flush force a round trip?  I guess on single-core systems
> this means two context switches per flush?
> Is there any way to minimize the amount of required
> flushes, maybe packing more images in a single request.

You shouldn't need to do any explicit flushes.  XCB will
take care of all this for you.  Just as with Xlib, there
will be no round trips (unless you ask for one).

There will be two context switches per 4K of sent protocol
requests, yes, but if you're using the shared memory
transport properly that should correspond to a lot of
pixmaps.  If you're not using shm, you'll get about 8
pixmaps stuffed out at a time, which should still work
pretty well.

In short, I doubt you'll have a performance problem if you
do things the "dumb way".  If you do, we can undoubtedly
figure out how to fix it.

Hope this helps.

    Bart Massey
    bart at cs.pdx.edu

More information about the Xcb mailing list