is D so slow?

Jarrett Billingsley kb3ctd2 at
Sun Jun 15 06:47:35 PDT 2008

"baleog" <maccarka at> wrote in message 
news:g32umu$11kq$1 at
> Tomas Lindquist Olsen Wrote:
>> What switches did you use to compile? Not much info you're giving ...
> Ubuntu-6.06
> dmd-2.0.14 - 40sec witth n=500
> dmd -O -release -inline test.d
> gdc-0.24 - 32sec
> gdmd -O -release test.d
> and gcc-4.0.3 - 1.5sec
> gcc test.c
> so gcc without optimization runs 20 times faster than gdc
> but i can't find how to suppress array bound checking

Array bounds checking is off as long as you specify -release.

I don't know if your computer is just really, REALLY slow, but out of 
curiosity I tried running the D program on my computer.  It completes in 1.2 

Also, using malloc/free vs. new/delete shouldn't much matter in this 
program, because you make all of three allocations, all before any loops. 
The GC is never going to be called during the program. 

More information about the Digitalmars-d-learn mailing list