Coolest D features

Benji Smith dlanguage at benjismith.net
Wed Dec 27 18:34:02 PST 2006


Bill Baxter wrote:
> 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?

Yes. He also subsequently did a "delete Foo" when he was finished with 
the object.

>> 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.

The C++ version eventually outperformed the Java version by 10% ~ 15%.



More information about the Digitalmars-d mailing list