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; return false;
} }
payload->set_type(type); payload->set_type(type);
std::unique_ptr<char[]> body(new char[size]()); // Don't waste time creating a new payload of identical size.
payload->set_body(body.get(), size); if (payload->body().length() != (size_t)size) {
std::unique_ptr<char[]> body(new char[size]());
payload->set_body(body.get(), size);
}
return true; return true;
} }

Loading…
Cancel
Save