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


Nathan Myers <ncm-nospam@cantrip.org> writes:

| On Tue, Jul 29, 2003 at 06:35:31AM +0200, Gabriel Dos Reis wrote:
| > Doug Gregor <dgregor@apple.com> writes:
| > 
| > |                     I don't know, but I do know we can do a pretty
| > | good job at the library level, and we can have it now on all platforms.
| > 
| > I'm not convinced this is an absolute win.  Thta is a tradeoff.
| > You're optimizing for space at the library level.  It is important to
| > know the effect on speed.  Optimizing for space tends to have a
| > negative effect on speed. 
| 
| Maybe it's just my limited imagination, but I can't imagine how 
| eliminating extra copies of identical functions, so that only one
| copy takes up space in cache, could possibly slow things down. 

The point is that, when you provide a flat/compressed representation
for a range of sets of objects, you need additional instructions to
bring back the type information.  It is therefore important to know
whether you have an effective win (not just a speculative win) on the
tradeoff you made.
For example, it is important to know whether calls the additional
wrappers are cost-free -- see

    http://gcc.gnu.org/ml/libstdc++/2003-05/msg00014.html

for precedent.

It is not all about size and number of copies.

-- Gaby


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