Description
Currently, the RawVec implementation tries to double its internal capacity every time it has to grow, as can be seen in:
rust/library/alloc/src/raw_vec.rs
Line 398 in 31a4f2d
But, according to Facebook's FBVector memory handling: it is suboptimal, as "it can be mathematically proven that a growth factor of 2 is rigorously the worst possible because it never allows the vector to reuse any of its previously-allocated memory" because "any new chunk requested will be larger than all previously used chunks combined, so the vector must crawl forward in memory; it can't move back to its deallocated chunks. But any number smaller than 2 guarantees that you'll at some point be able to reuse the previous chunks."
They use a growth factor of 1.5.
Maybe it is worth considering changing the growth factor for the standard library to a theoretically more optimal value.