Avoid benchmarking allocs

pull/11959/head
ncteisen 8 years ago
parent 1d27c66d8e
commit 0133cc6fd8
  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