[RFC] Vector (string?) growth factor of 1.5 (insted of 2)

Paolo Carlini pcarlini@suse.de
Mon Feb 2 15:24:00 GMT 2004


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.



More information about the Libstdc++ mailing list