[Xcb] [Bug 29743] dynamic protocol bindings

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Aug 28 22:23:59 PDT 2010


--- Comment #1 from Havoc Pennington <hp at pobox.com> 2010-08-28 22:23:59 PDT ---
Created an attachment (id=38254)
 View: https://bugs.freedesktop.org/attachment.cgi?id=38254
 Review: https://bugs.freedesktop.org/review?bug=29743&attachment=38254

hacky xcb_send_request_dynamic just to get initial idea of perf/size impact

Patch reduces xcb_create_window() to a one-line function in a simpleminded way.
This isn't introspection in a meaningful sense, just a cheap way to see if
dynamic marshaling is small or slow.

The basic results are:

* the function comes out around 20 bytes smaller, but the separate description
of how to marshal is about 20 bytes long, so no size win or lose.

* therefore the only size win would be to drop the wrapper functions from the
library entirely, replacing them with inline functions in the header that just
added type safety/convenience to xcb_send_request_dynamic()

* the marshaling is about 1.7 times slower. this is just creating the iovecs,
does not include writing to the socket, so 1.7 times is the worst possible
slowdown (if you have infinitely fast IO) rather than a real world slowdown.

Looks like no real point in dynamic request marshaling unless it's possible to
drop the wrappers from the ABI and go to just inline wrappers in the headers.
If doing that the size benefit of dropping all wrappers from the shared lib
could be worth the perf cost. But, not ABI compatible obviously.

This isn't saying anything about other benefits of providing programmatic
access to the protocol descriptions - the point of this patch was just to
understand tradeoffs of dynamic request marshaling.

Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the Xcb mailing list