[libcxx-dev] LIBC++ Container classes use known bad 2X growth policy

Joe Laughlin via libcxx-dev libcxx-dev at lists.llvm.org
Wed Jul 17 11:58:26 PDT 2019


Hello Everyone,

LIBC++ STL container growth policy is 2X which saves CPU but can be horrible for RAM and VA space. Can this be changed to 1.5X?

Reference documentation on why 2X is bad can be found in the links below.

https://lokiastari.com/blog/2016/03/25/resizemaths/

There's also this thread on comp.lang.c++, but the above article has the math proof that none of the other articles I have seen have.

https://groups.google.com/forum/#!topic/comp.lang.c++.moderated/asH_VojWKJw%5B1-25%5D

If you're really interested, this article goes into more detail.

https://web.archive.org/web/20150813230959/https://github.com/facebook/folly/blob/master/folly/docs/FBVector.md<https://web.archive.org/web/20150813230959/https:/github.com/facebook/folly/blob/master/folly/docs/FBVector.md>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libcxx-dev/attachments/20190717/e8cbb63a/attachment-0001.html>


More information about the libcxx-dev mailing list