A modest proposal: eliminate template code bloat

H. S. Teoh hsteoh at quickfur.ath.cx
Mon Apr 9 06:08:41 PDT 2012


On Mon, Apr 09, 2012 at 08:21:08AM +0200, Somedude wrote:
> 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++.

Exactly my point. I *want* to give incentive to toolchain devs to add
these kinds of enhancements to linkers in general.


T

-- 
Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth? -- Michael Beibl


More information about the Digitalmars-d mailing list