Avoid Benchmarking Allocs
@ -80,8 +80,11 @@ class Server {
return false;
}
payload->set_type(type);
std::unique_ptr<char[]> body(new char[size]());
payload->set_body(body.get(), size);
// Don't waste time creating a new payload of identical size.
if (payload->body().length() != (size_t)size) {
return true;