News for hackers. Stuff that matters.
Re:Drop millions of allocations by using a linked list (2015) by spacechild1 on Friday March 12, 2021 @08:04AM (#26435387)
That's exactly the purpose of std::vector's “reserve“ method, btw.
Re:Drop millions of allocations by using a linked list (2015) by twoodfin on Friday March 12, 2021 @08:24AM (#26435556)
I once worked with a C++ text processing library that saw more than a 50% throughput bump just from reserve()’ing std::string and std::vector space in hot code paths.