inlining...

Ola Fosheim Grøstad" <ola.fosheim.grostad+dlang at gmail.com> Ola Fosheim Grøstad" <ola.fosheim.grostad+dlang at gmail.com>
Tue Mar 18 06:11:12 PDT 2014


On Saturday, 15 March 2014 at 04:17:06 UTC, Manu wrote:
> I'd say it should inline only func. Any sub-calls are subject 
> to the
> regular inline heuristics.

I agree with you that explicit inlining is absolutely necessary 
and that call site inlining is highly desirable. However, I think 
that the call-site inlining should inline as much as possible. 
Basically this is something you will try when the code is too 
slow to meet real time deadlines and you hope to avoid going for 
a hand optimized solution in order to cut down on dev time. That 
suggests aggressive inlining to me.

If the inlining only goes one level then I don't think this will 
be used frequently enough to be useful, e.g. you can just create 
one inline version and then a non-inline version that calls the 
inline version.

E.g.:

noninline_func(){ inline_func();}


Ola.


More information about the Digitalmars-d mailing list