News for hackers. Stuff that matters.
Re:Identifying Rust's collect:<Vec<_>>() memory leak footgun by Dylan16807 on Friday January 19, 2024 @03:32PM (#39060731)
Sure. It's a tradeoff to avoid wasting huge amounts of memory once the list gets huge.

No matter what the growth factor, you want to set the capacity up front if you know it. But 2x and 1.25x are both reasonable.

There are no comments on this comment yet.