Creeping Bloat in Phobos

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Sat Sep 27 17:23:32 PDT 2014


On 9/27/14, 4:02 PM, Walter Bright wrote:
> On 9/27/2014 3:59 PM, Brad Roberts via Digitalmars-d wrote:
>> Look at Peter's example, it's better for this, I believe.  Why isn't
>> empty being
>> inlined?  That's a tiny little function with a lot of impact.
>
> It's the autodecode'ing front(), which is a fairly complex function.

front() should follow a simple pattern that's been very successful in 
HHVM: small inline function that covers most cases with "if (c < 0x80)" 
followed by an out-of-line function on the multicharacter case. That 
approach would make the cost of auto-decoding negligible in the 
overwhelming majority of cases.

Andrei


More information about the Digitalmars-d mailing list