A modest proposal: eliminate template code bloat

Somedude lovelydear at mailmetrash.com
Sun Apr 8 23:21:08 PDT 2012


Le 08/04/2012 16:18, H. S. Teoh a écrit :
> On Sun, Apr 08, 2012 at 03:01:56PM +0400, Dmitry Olshansky wrote:
>> I think it's been ages since I meant to ask why nobody (as in
>> compiler vendors) does what I think is rather simple optimization.
>>
>> In the short term the plan is to introduce a "link-time" flavored
>> optimization at code generation or (better) link step.
> 
> This would be incompatible with how current (non-dmd) linkers work. But
> I do like the idea. Perhaps if it works well, other linkers will adopt
> it? (Just like how the gcc linker adopted duplicate template code
> elimination due to C++ templates.)
> 
> T
> 

Actually, in C++ (as well as D), the added benefit would be a greatly
improved compilation speed, wouldn't it ?
I bet if the idea works in D and proves increased compilation, compiler
writers would be very compelled to implement it in C++.


More information about the Digitalmars-d mailing list