Moritz Warning:
> I have noticed the same problem with foreach.
> A for loop is often faster. :/

You generally notice a difference only in the most inner and critical loops, so 
I think it's okay to use foreach() in 80-90% of the code of a program.


> I haven't tried ldc yet..

I haven't succeed in compiling code with ldc yet. But I have tried the last 
LLVM with the C code of the nbody benchmark of the Shootout, and GCC (MinGW) 
4.2.1 produces code about twice faster on my Core2. That's even quite worse 
than the D code compiled with DMD.

Bye,
bearophile

Reply via email to