www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Queue Performance, etc. (was "Thread Failed To Start")

My streamlined version of the inter-thread queue tester is more reliable
(though it still freezes sometimes.  I am trying to isolate it and will post
if I do).

But running the resulting comparison has led to some observations:

1. As I noted earlier, the lockfree linked-list based queues are the fastest
by a large margin (over a synchronized array-based or linked-list based queue
and message passing).

2. That gap closes some (to more like 2x or 3x faster) if the size of the
messages increases, but the lockfree are still the fastest.

3.  I love D.  I was running on OSX, copied the files to my Windows machine
and they compiled and ran fine.  So awesome.

3a. My windows machine is, I think, 2 x 2.4 GHz Quad Core Xeon and my mac is 2
x 2.8 Quad Core GHz Xeon.  The inter-thread queues run 2 or 3x faster on OSX.
I will try linux boxes later this week.

3b.  Are "systime()" and "Thread.sleep()" portable?  The timing on the windows
is weird.  The sleep between packet sending seems too short and some of the
timings seem way off.  If that is a portability issue, I may revise 3a.

4. I tried receive vs. receiveOnly in the message passing (MP) version and it
made no difference to the latency characteristics.

5. MP has a much larger minimum latency (avg of fastest 1% of packets around
8us vs 0 to 1 for the others).

Jan 03 2011