is D so slow?

Jarrett Billingsley kb3ctd2 at yahoo.com
Mon Jun 16 07:58:22 PDT 2008


"Dave" <Dave_member at pathlink.com> wrote in message 
news:g34sja$2m1a$1 at digitalmars.com...

>
> I agree, but nonetheless the malloc version runs much faster on my systems 
> (both Linux/Windows, P4 and Core2, all compiled w/ -O -inline -release). 
> The relative performance difference gets larger as n increases:
>
> n            malloc        GC
> 100        0.094         0.328
> 200        0.140         1.859
> 300        0.203         6.094
> 400        0.312        14.141
> 500        0.547        27.625

I'm sorry, but using your code, I can't reproduce times anywhere near that. 
I'm on Windows, DMD, Athlon X2 64.  Here are my results:

Phobos:

 n    malloc       GC
------------------------
100  0.005206   0.005285
200  0.045083   0.045199
300  0.148954   0.148920
400  0.400136   0.404554
500  0.933754   1.076060

Tango:

 n    malloc       GC
------------------------
100  0.005221   0.005298
200  0.045342   0.044910
300  0.150753   0.149157
400  0.402951   0.403343
500  0.946041   1.073466

Tested with both Tango and Phobos to be sure, and the times are not really 
any different between the two.

The malloc and GC times don't really differ until n=500, and even then it's 
not by much. 




More information about the Digitalmars-d-learn mailing list