Message passing between threads: Java 4 times faster than D

Nicolae Mihalache xpromache at gmail.com
Thu Feb 9 01:06:40 PST 2012


Hello,

I'm a complete newbie in D and trying to compare with Java. I
implemented  a simple test for measuring the throughput in message
passing between threads. I see that Java can pass about 4mil
messages/sec while D only achieves 1mil/sec. I thought that D should
be faster.

The messages are simply integers (which are converted to Integer in Java).

The two programs are attached. I tried compiling the D version with
both dmd and gdc and various optimization flags.

mache
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mp.d
Type: text/x-dsrc
Size: 763 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120209/76e01c82/attachment.d>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ThroughputMpTest.java
Type: text/x-java
Size: 1417 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120209/76e01c82/attachment.java>


More information about the Digitalmars-d mailing list