DIP56 Provide pragma to control function inlining

Dicebot public at dicebot.lv
Sun Feb 23 16:37:28 PST 2014


On Monday, 24 February 2014 at 00:33:09 UTC, Walter Bright wrote:
> I suspect that elevating one particular optimization hint to 
> being an absolute command may not turn out well. Inlining 
> already has performance issues, as it may increase the size of 
> an inner loop beyond what will fit in the cache, for just one 
> unexpected result. For another it may mess up the register 
> allocation of the caller. "Inlining makes it faster" is not 
> always true. Do you really want to weld this in as an absolute 
> requirement in the language?

The fact that original C "inline" was designed in same 
"permissive" way and is almost unused in practice (as opposed to 
compiler-specific force_inline attributes) does say something.

It is not feature that should be design for mass usage.


More information about the Digitalmars-d mailing list