Is there a way to get a list of functions that get inlined by

Scorn scorn at trash-mail.com
Mon Feb 8 12:06:10 PST 2010


bearophile schrieb:
> Scorn:
>> The only things i figured out so far is that functions across modules do
>> not seem to get inlined (i don't know if this is the case in general)
>> which would be really bad. Another thing which i believe is that
>> functions / methods which contain ref parameters are never inlined at
>> all (which is again really annoying since it's not a clever way passing
>> huge structs by value).
> 
> Use LDC (D1), you will note a significant improvement over DMD.
> 
> Bye,
> bearophile


Hi bearophile. Thanks for your advice (i might try out ldc in the future
but now i need phobos and not tango as standard library).

At the moment i am using gdc where i nearly always see a significant
improvement regarding the speed of the produced code when comparing to dmd.

But since all three dmd, ldc and gdc use the same frontend, the question
from Trass3r still remains:

Under which conditions are functions/methods inlined ?

Do you know if ldc inlines functions/methods across modules ? (dmd
doesn't seem to do it and neither does gdc).

And that is bad since for an actual project i have made a separate
module with a lot of small utility math functions which should be
inlined but don't because of this. When i inline them using mixins or
manually i get an overall speed up of about 20%.








More information about the Digitalmars-d-learn mailing list