blocks with attributes vs inlined lambda

monarch_dodra monarchdodra at gmail.com
Wed Jun 19 04:23:35 PDT 2013


On Tuesday, 18 June 2013 at 08:10:24 UTC, monarch_dodra wrote:
>> Inlining should remove performance penalty. Nobody holds the 
>> immediately
>> called lambda, so it should be treated as a 'scope delegate'. 
>> For that, we
>> would need to add a section in language spec to support it.
>
> Alright.

I did some benching, and they aren't getting inline (well... I 
don't *think* they are): Code with an inline lambda call is 
definitely slower (in my case, with no args passed).

My tests are somewhat synthetic, (I'm testing a rather short 
function with a lambda) but the overall slowdown is quite 
noticeable. I don't worry about it much, but I guess these could 
scale in the grand scheme of things, and is a bit vexing when all 
you wanted to was mark something as trusted :/

Shouldn't an inlined lambda call *always* be... inlined? I really 
don't see a reason not to do so, but I'm outside my field of 
competence at that point.


More information about the Digitalmars-d mailing list