[Xcb] Interning multiple atoms w/ one function call (alla XInternAtoms)

Vincent Torri Vincent.Torri at iecn.u-nancy.fr
Fri Sep 30 23:20:45 PDT 2005


hey,

this morning, i wanted to code the 2 different methods and compute the
time that each one takes. The code is here :

http://www.iecn.u-nancy.fr/~torri/files/xcb/test_speed.c

the correct use of xcb is 33 times faster to the bad use with most of the
execution of the test (500 created atoms).

well, just FYI ;)

regards

Vincent

On Wed, 10 Aug 2005, Carl Worth wrote:

> On Wed, 10 Aug 2005 23:43:42 +0200 (CEST), Vincent Torri wrote:
> > So, when the allocation fails, ok, I see why there are N
> > round-trips.
>
> Here's a time-line for N==4 with a round-trip latency (T_round_trip)
> that is 5 times as long as the time required to write or read a
> request/reply (T_write/T_read) [*].
>
> 	W-----RW-----RW-----RW-----R
>
> W: Writing request
> -: Stalled, waiting for data
> R: Reading reply
>
> Total time: N * (T_write + T_round_trip + T_read)
>
> > But when it does not fail, there are N requests for the N atoms. Then we
> > ask for N replies. So we always ask N times the server. So i don't
> > understand the improvement.
>
> And here's the time-line for the two-loop version, again N==4 and the
> same latency is in effect:
>
> 	WWWW--RRRR
>
> Total time: N * T_write
> 	  + max (0, T_round_trip - ((N-1) * T_write))
> 	  + N * T_read
>
> So, as you can (hopefully) see, the two-loop version takes a worst
> case penalty of one round-trip latency over the time required to just
> write and read as fast as possible.
>
> Does that help?
>
> And do let me know if I botched the figures or equations anywhere.
>
> -Carl
>
> [*] I won't claim the proportions here are realistic. A small integer
> ratio just happens to be convenient for the ASCII artwork. I have no
> idea what the actual timing proportions are likely to be in a
> real-world scenario, but an interested party can measure them.
>


More information about the Xcb mailing list