Why is this D code slower than C++?

%u u at infearof.spm
Wed Jan 17 05:04:20 PST 2007


== Quote from Bill Baxter (dnewsgroup at billbaxter.com)'s article
> I noticed that it doesn't work properly with -release add to the
> compiler flags.
That is because in testapp.d the call of RegisterClass is put into
an assertion.

On my machine the -release flag brings another 25%.

> The inout on the Ray parameter and the other changes to this
> function alone change my D runtime from 22 sec to 15 sec.

The compiler should be smart enough to detect, that the Ray
parameter is not used as an lvalue and thus can be replaced by a
reference.


More information about the Digitalmars-d-learn mailing list