Skip to content

re: Efficient way of using std::vector VIEW POST


Another fun way STL containers can be misused is not understanding the underlying memory management enough. Growing an std::vector by naively pushing elements and letting the container grow automatically is much, much slower than pre-allocating if you know the roughly how large your data set will be.

code of conduct - report abuse