noinline, forceinline, builtin_expect

safety0ff via Digitalmars-d digitalmars-d at puremagic.com
Fri Jan 2 12:28:20 PST 2015


On Friday, 2 January 2015 at 14:34:39 UTC, Martin Nowak wrote:
> Would be nice to have @noinline, @forceinline and 
> __builtin_expect.

It's rare to get measurable gains from __builtin_expect, and 
since there is no macro preprocessor in D, it's likely less 
verbose to just put the common case as the first branch since 
most compilers use that for static branch prediction (with the 
same effect on resulting machine code as __builtin_expect.)

Just my 2c.


More information about the Digitalmars-d mailing list