Garbage collection in D

Tim Matthews tim.matthews7 at gmail.com
Tue Jun 2 17:45:10 PDT 2009


Diwaker Gupta wrote:
> I've just started to play around with D, and I'm hoping someone can clarify this. I wrote a very simple program that just allocates lots of objects, in order to benchmark the garbage collector in D. For comparison, I wrote the programs in C++, Java and D:
> C++: http://gist.github.com/122708
> Java: http://gist.github.com/122709
> D: http://gist.github.com/121790
> 
> With an iteration count of 99999999, I get the following numbers:
> JAVA:
> 0:01.60 elapsed, 1.25 user, 0.28 system
> C++:
> 0:04.99 elapsed, 4.97 user, 0.00 system
> D:
> 0:25.28 elapsed, 25.22 user, 0.00 system
> 
> As you can see, D is abysmally slow compared to C++ and Java. This is using the GNU gdc compiler. I'm hoping the community can give me some insight on what is going on.
> 
> Thanks,
> Diwaker

Can someone try dmd and ldc as gdc is dying (if not already dead). Also 
code in the iterations and take out the command line reading and 
printing so to make it accurate.


More information about the Digitalmars-d-learn mailing list