size_t s = v.size() + count; if (s > v.capacity()) { v.reserve(growth_policy(s)); } v.insert(v.end(), ptr, ptr + count);
I had Buffer::append which was doing something along those lines as the backing container for Buffer was std::vector<u8>.
Here's the commit from December 14, 2018. Notice the call to reserve on overflow?
At this point in conversation I would like to see your version of the code that improves the performance EVEN IN THE SLIGHTEST AMOUNT. Even 5% will be appreciated!!! It all comes from a budget of 64 core ARM64 _aarch64 server running streaming real-time compression. More clients we can serve with same amount of hardware the more money will be saved.