pull/10329/head
Craig Tiller 8 years ago
parent 0d04e0697b
commit 61c317b624
  1. 9
      test/cpp/microbenchmarks/bm_chttp2_hpack.cc

@ -147,9 +147,12 @@ template <int kLength>
class SingleInternedBinaryElem { class SingleInternedBinaryElem {
public: public:
static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) { static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) {
return {grpc_mdelem_from_slices( grpc_slice bytes = MakeBytes();
std::vector<grpc_mdelem> out = {grpc_mdelem_from_slices(
exec_ctx, grpc_slice_intern(grpc_slice_from_static_string("abc-bin")), exec_ctx, grpc_slice_intern(grpc_slice_from_static_string("abc-bin")),
grpc_slice_intern(MakeBytes()))}; grpc_slice_intern(bytes))};
grpc_slice_unref(bytes);
return out;
} }
private: private:
@ -325,6 +328,8 @@ static void BM_HpackParserParseHeader(benchmark::State &state) {
} }
grpc_exec_ctx_flush(&exec_ctx); grpc_exec_ctx_flush(&exec_ctx);
} }
for (auto slice : init_slices) grpc_slice_unref(slice);
for (auto slice : benchmark_slices) grpc_slice_unref(slice);
grpc_chttp2_hpack_parser_destroy(&exec_ctx, &p); grpc_chttp2_hpack_parser_destroy(&exec_ctx, &p);
grpc_exec_ctx_finish(&exec_ctx); grpc_exec_ctx_finish(&exec_ctx);
track_counters.Finish(state); track_counters.Finish(state);

Loading…
Cancel
Save