Merge pull request #11959 from ncteisen/qps-opt

Avoid Benchmarking Allocs
pull/11356/merge
Noah Eisen 7 years ago committed by GitHub
commit 80b688b317
  1. 7
      test/cpp/qps/server.h

@ -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) {
std::unique_ptr<char[]> body(new char[size]());
payload->set_body(body.get(), size);
}
return true;
}

Loading…
Cancel
Save