This is the mail archive of the
mailing list for the libstdc++ project.
Re: [libstdc++ PATCH/RFC] Aggressive space optimization for std::vector
- From: Nathan Myers <ncm-nospam at cantrip dot org>
- To: libstdc++ at gcc dot gnu dot org
- Date: Mon, 28 Jul 2003 13:16:49 -0700
- Subject: Re: [libstdc++ PATCH/RFC] Aggressive space optimization for std::vector
- References: <06145F94-C135-11D7-AD9F-00039354D67A@apple.com>
On Mon, Jul 28, 2003 at 12:52:31PM -0700, Doug Gregor wrote:
> The attached patch implements an aggressive space optimization for
> vector, where we share a bit of the vector code for a POD type with all
> other POD types with the same size/alignment. ...
> ... I'd like to know if this type of optimization is
> desired in libstdc++. It uglifies the source a bit, but it can be a
> boon to users.
The amount saved for vector, by itself, doesn't seem worth the
obfuscation, but I assume this patch is practice for (e.g.) _Rb_tree,
where the member algorithms are much more substantial, and the savings
proportionally more valuable.
Usually, when the subject arises, it turns to getting the linker to
recognize functions that result in the same sequence of object code,
equating them, and throwing away the extra copies. Is there any
prospect of Apple improving the linking process, instead? (And, in
a way that helps gld systems too? Does macosix use a BSD linker or
A lot of mileage might be derived, too, from making better choices of
which member functions to mark "inline".