Creeping Bloat in Phobos

Brad Roberts via Digitalmars-d digitalmars-d at puremagic.com
Sat Sep 27 15:59:55 PDT 2014


On 9/27/2014 3:54 PM, Walter Bright via Digitalmars-d wrote:
> On 9/27/2014 3:26 PM, Brad Roberts via Digitalmars-d wrote:
>> What we're seeing here is pretty much the same problem that early c++
>> suffered
>> from: abstraction penalty.  It took years of work to help overcome it,
>> both from
>> the compiler and the library.  Not having trivial functions inlined and
>> optimized down through standard techniques like dead store
>> elimination, value
>> range propagation, various loop restructurings, etc means that code
>> will look
>> like what Walter and you have shown.  Given DMD's relatively weak
>> inliner, I'm
>> not shocked by Walter's example.  I am curious why ldc failed to
>> inline those
>> functions.
>
> Again, this accumulation of barnacles is not a failure of the optimizer.
> It's a failure of adding gee-gaws to the source code without checking
> their effect.

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.

Of course there's more than just optimization, but it's a big player in 
the game too.


More information about the Digitalmars-d mailing list