[Xcb] Re: To XCB or not to XCB ...

Vincent Torri vtorri at univ-evry.fr
Mon Sep 11 00:00:33 PDT 2006


>> There is a very small, but measurable, performance hit to using XCB,
>> made marginally worse when Xlib is used on top.
>
> Is this about the fact that XCB is split up into a large number of
> ridiculously small libraries that'll no doubt make ld.so choke with any
> somewhat larger application or is this something else?

No. It's because Xlib uses a bigger cache size. Whe I use the same cache 
size for XCB, the performance are almost the same. The benchmark I use 
(and which Jamey mentions) shows a difference of 0.1 fps. Of course this 
bench is also very related  to the design of the engine used in the 
benchmark. Finally, this benchmark only uses xcb and the xcb-image lib.

another point is that xcb has not been heavily designed.

>> We know how to improve
>> this performance somewhat, but it hasn't happened yet. Of course, when
>> apps and libraries start migrating to XCB, they'll be able to gain
>> significant performance improvements by taking advantage of XCB's better
>> API.
>
> Is it possible to find some more details on this? I couldn't find anything on
> the XCB website and I wonder how XCB should provide "significant" performance
> improvements over something that's not much more than just a tool for talking
> the wire X protocol.

Yes. Look at the tutorial in src/doc/tutorial. There is a section about 
requests/replies. And a small program that you can compile to see the 
speed difference between Xlib and XCB when XCB is correctly used (on my 
computer, that program is 25 times faster with XCB than with Xlib).

Also, here is the mail I used for that part of the tutorial, thanks to 
Carl Worth, if you have difficulties to find the tutorial :

http://lists.freedesktop.org/archives/xcb/2005-August/001042.html

The problem with Xlib is that it is talking badly to the server, whereas 
XCB is polite :)

I hope that this answers some of your questions.

regards

Vincent


More information about the Xcb mailing list