Bug 7382 - XCB should construct requests directly in the output buffer if there is room
Summary: XCB should construct requests directly in the output buffer if there is room
Status: RESOLVED WONTFIX
Alias: None
Product: XCB
Classification: Unclassified
Component: Library (show other bugs)
Version: unspecified
Hardware: All All
: high normal
Assignee: Jamey Sharp
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-30 22:33 UTC by Ian Osgood
Modified: 2006-11-12 18:45 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Ian Osgood 2006-06-30 22:33:14 UTC
XCB should construct requests directly in the output buffer if there is room.  Xlib does this.  Bart 
remembers that XCB used to do this before the introduction of writev?  According to keithp, this makes 
the common case (a few small requests before a flush) much faster.
Comment 1 Jamey Sharp 2006-11-12 18:45:06 UTC
Thanks for recording this bit of conversation, Ian. You and I chatted about this
at some point, but I want to record my reasoning for future reference.

I claim XCB stubs should not write directly to the output queue, because that
exposes too much of the implementation of the transport layer. It destroys the
atomicity properties of the API, making the underlying locks visible; and it
constrains us to a limited set of output-queue configurations, not to mention
forcing us to have an output queue in the first place. It also increases the
code size of every single generated stub.

I claim the right place to eliminate a copy is between the caller and the stub,
where all the request parameters are passed through the stack at native
alignment before being copied into a naturally-aligned buffer. If we inline the
stubs in the caller, as suggested in bug #6687, then that copy will be gone and
we should see the same kind of performance boost as this bug's suggestion would
provide.

Meanwhile, we have ways of reducing the cost of the memcpy in xcb_send_request,
and we just need to implement them.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.