String is there just for the test if it works (and yes i noticed it does )...
Anyway... the time it takes to run this when compiled with (dmd -inline -release filename.d)
is the same as that of java (I wrote the same thing in java).

Am I doing something wrong or are loops equally fast? where is D faster?

Okay, first thing is, assuming you don't have any important stuff in your DMD installations, just delete all of it.
Then, extract dmd1.045 to where ever you want to install it. (C:\dmd)
Add C:\dmd\windows\bin to your path. (Use google if you don't know how to do that)
The reason is that in a (somewhat) recent dmd release, the bin and lib folders were moved to linux/, windows/, and mac/.
Also, also add -O (that is an o, not a zero) when you compile, so it's: