Coolest D features

Bill Baxter dnewsgroup at billbaxter.com
Wed Dec 27 16:28:32 PST 2006


Benji Smith wrote:

> 
> Then, because this algorithm needed to be deployed to heterogeneous 
> environments, a colleague of mine ported my code to C++. He did a 
> straight transliteration of the code, preserving the same semantics from 
> the Java to C++.

Does that mean that wherever you did "new Foo" he did a "new Foo" also?


> When we timed both implementations, we discovered that mine was 40 
> percent faster. Several of the C++ developers on my team were completely 
>  incredulous, and they made it their personal quest to optimize the C++ 
> version so that it was the performance winner.
> 
> They eventually caught up to, and surpassed, the performance of the Java 
> code. 

Any idea by how much the C++ surpassed the Java in the end?  Was it 
about the same margin (~40%) or significantly more or less?  It's a big 
difference between 10x the Java performance vs say only 5% faster.

> To echo what others have said before me, you will *never* win over any 
> Java programmers to D by emphasizing performance.

Probably not, if we're talking about someone who has Java Programmer 
with a capital P embossed on their business card.  But I hear that it's 
pretty common these days for schools to teach Java as the main 
programming language to students.  If that's true, then it seems 
reasonable that there is a category of people using Java simply because 
it's what they were taught, and they might be interested in a language 
with syntax not too far from Java which at least in benchmarks 
significantly outperforms java:
http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=dlang&lang2=java
(and which doesn't require a VM)

--bb



More information about the Digitalmars-d mailing list