This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[RFC] Vector (string?) growth factor of 1.5 (insted of 2)
- From: Paolo Carlini <pcarlini at suse dot de>
- To: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Cc: Nathan Myers <ncm at cantrip dot org>
- Date: Mon, 02 Feb 2004 16:22:18 +0100
- Subject: [RFC] Vector (string?) growth factor of 1.5 (insted of 2)
Hi everyone,
I'm studying a recent discussion thread on comp.lang.c++.moderated
(google for 'vector growth factor of 1.5' if you are interested)
according to which this value, instead of the more common 2, should
be preferred.
Naively, one could believe that which value is better (provided the
exponential requirements are fulfilled) should be decided empirically,
or even, that each application has its "best" value.
Interestingly, however, Andrew Koenig pointed out that there are
*theoretical* reasons (related basically to memory fragmentation) to
prefer 1.5 to 2.
Any opinions?
As far as performance is concerned, actually my first rough test seem
to show a really *minor* negative impact, so, if memory usage is so
much better..
Paolo.