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]

[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.


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