This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: empty function optimizations


I wrote:
> > Ideally, the STL we provide should use a lot more partial specialization;
> > for example

Thomas Kunert writes:
> IMHO, that's the wrong approach. It's better to have an optimization in
> the compiler than to uglify the code. And the code gets ugly if you do
> that.

The code is not uglified by adding specializations, properly performed.
Code that uses the template classes stays exactly the same.

> Why should I do what the compiler could do for me?

The proposal on the table was to have the linker (not the compiler) do it
for you.  Ideally, the library developers would do this for you.

You want to generate tons of redundant code and then rely on a pass to
clean up some (but far from all) of the redundant code at link time,
instead of fixing the STL so that we avoid generating redundant template
expansions in the first place?

We're running into trouble in my organization with pumping gigabytes of
redundant debug information and object code over NFS networks when trying
to build large C++ projects.  The way to address this is to concentrate
on not generating so much crap in the first place, rather than in trying
to clean it up at link time.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]