You can specify the capacity on creation: Vec::with_capacity(foo)
There are also alternative vector like types for different use cases, and you can roll your own.
There are also alternative vector like types for different use cases, and you can roll your own.
Note: gameswithgo you seem to be shadow banned. Your comment history looks alright tho. You may want to email hn@ycombinator.com asking to have that fixed (edit: found the culprit https://news.ycombinator.com/item?id=30732886)