D 50% slower than C++. What I'm doing wrong?

ReneSac reneduani at yahoo.com.br
Mon Apr 16 15:24:03 PDT 2012


On Monday, 16 April 2012 at 07:28:25 UTC, Andrea Fontana wrote:
> Are you on linux/windows/mac?

Windows.

My main question is now *WHY* D is slower than C++ in this 
program? The code is identical (even the same C functions) in the 
performance-critical parts, I'm using the "same" compiler backend 
(gdc/g++), and D was supposed to a fast compilable language. Yet 
it is up to 50% slower.

What is D doing more than C++ in this program, that accounts for 
the lost CPU cycles? Or what prevents the D program to be 
optimized to the C++ level? The D front-end?


More information about the Digitalmars-d-learn mailing list