Use xcb for -queryExt instead of a round-trip per extension
authorAlan Coopersmith <alan.coopersmith@oracle.com>
Sun, 3 Oct 2010 18:47:07 +0000 (11:47 -0700)
committerAlan Coopersmith <alan.coopersmith@oracle.com>
Mon, 4 Oct 2010 15:14:48 +0000 (08:14 -0700)
commit072fc46b2af370e78fa53426626ca3c33b74bdf2
tree575a85d3e1451e604f81c3292102356b37019c3e
parent30bc4b0ada659809c64f6a8292cbde3166267e8d
Use xcb for -queryExt instead of a round-trip per extension

On a system with 30 extensions listed by xdpyinfo, truss -c
reports this saves quite a few system calls by batching the
QueryExtension requests instead of a round-trip for each one:

                      Xlib      xcb
writev                  40       11
poll                    80       22
recv                   117       29
total (*)              464      296

(*) total includes all system calls, including many not shown since
their count did not change significantly.   There was one additional
set of open/mmap/close etc. for loading the added libX11-xcb library.

Over a tcp connection, this reduced both the number of packets,
and due to tcp packet header overhead, the overall amount of data:

                      Xlib      xcb
TCP packets             93       35
TCP bytes            11554     7726

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
configure.ac
xdpyinfo.c