[Solved] speeding vector push_back [closed]
Indeed push_back may trigger reallocation, which is a slow process. It will not do so on every single push_back though, instead it will reserve exponentially more memory each time, so explicit reserve only makes sense if you have a good approximation of resulting vector size beforehand. In other words, std::vector already takes care of what … Read more