Message passing between threads: Java 4 times faster than D
alex_dovhal at yahoo.com
Thu Feb 9 02:57:37 PST 2012
"Nicolae Mihalache" <xpromache at gmail.com> wrote:
> 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.
Hi, I downloaded your two programs, I didn't run them but noticed that in
you have n set to 100_000_000, while in 'ThroughputMpTest.java' n is set to
10_000_000, so with this D code is 10/4 = 2.5 times faster :)
More information about the Digitalmars-d