Why is this D code slower than C++?

Dave Dave_member at pathlink.com
Wed Jan 17 10:37:30 PST 2007


%u wrote:
> == 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.

In that respect I'd like to see 'byref' be a synonym for 'inout' as well, so we can tweak those 
things w/o relying on the compiler, or by using a keyword (inout) that doesn't really fit the 
situation in which it's being used.


More information about the Digitalmars-d-learn mailing list