[Xcb] problem when getting replies

Jamey Sharp jamey at minilop.net
Sun Nov 12 14:55:28 PST 2006


On Sun, Nov 12, 2006 at 01:25:47PM +0100, Vincent Torri wrote:
> Many thanks, Jamey :) Now, ecore_xcb should work, except some minor fixes 
> to do :) The biggest fix would be to improve my ugly api :)

This is really cool, Vincent! Nice work!

> How do I use xcb_get_maximum_request_length ? I just store its value
> somewhere and I don't use it ? Or should I use it somewhere ?

You don't have to store the return value. (More reason to have a
'prefetch' variant that has no return value...) XCB caches the maximum
request length, so after the first time, calling it is fast.

You should use it when constructing a request that might get big,
though. If you construct a request that's too big, XCB will detect that
it can't send it, and shut down your connection.

Now, exactly how to use it for this purpose isn't entirely obvious. It's
an area that needs a bit of thought still.

> On Sun, 12 Nov 2006, Jamey Sharp wrote:
> >That's two round trips, and you can't do any better in the X protocol, I
> >believe.
> 
> ok. That's already better than Xlib.

Yes, it most certainly is. By the time XOpenDisplay returns, it has
already waited for three round-trips, all useless for modern apps, but
your code is done after only two.

> Here is a small bench for the initialization of ecore_x(cb):
> 
> ecore_x time...: 0.009973
> ecore_xcb time.: 0.002292
> 
> That is, almost 5 times faster. I don't think I can do much more.

Sweet! That's awesome.

Could you test across an internet connection? You know, `ssh -X`
somewhere and run the benchmarks on the remote machine? I bet you'd get
even more dramatic numbers, especially over a link with >100ms round
trip time.

> I don't know if that is important for the numbers, but I run a non
> optimized XCB (compiled with -g).

It shouldn't have much effect here: these measurements should be
dominated by round-trip delay.

> Indeed, I do not support the damage extension (I run xorg 6.7...)

Wow, that's old. :-)

> That would be nice if you can write such function :)

OK, I've written xcb_prefetch_maximum_request_length. Except I can't
build XCB right now, because xsltproc is broken (it segfaults), so I'm
not sure I've got it right. I'll push it when I can compile it. :-/

--Jamey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20061112/abd703b0/attachment.pgp


More information about the Xcb mailing list