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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [libstdc++ PATCH/RFC] Aggressive space optimization for std::vector


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 
GNU ld?)

A lot of mileage might be derived, too, from making better choices of 
which member functions to mark "inline".  

Nathan Myers
ncm-nospam@cantrip.org


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