bm_chttp2_hpack.cc
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2015 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 /* Microbenchmarks around CHTTP2 HPACK operations */
20 
21 #include <string.h>
22 
23 #include <memory>
24 #include <sstream>
25 
26 #include <benchmark/benchmark.h>
27 
28 #include <grpc/slice.h>
29 #include <grpc/support/alloc.h>
30 #include <grpc/support/log.h>
31 
43 
45  grpc_core::ResourceQuota::Default()->memory_quota()->CreateMemoryAllocator(
46  "test"));
47 
48 static grpc_slice MakeSlice(const std::vector<uint8_t>& bytes) {
51  for (auto b : bytes) {
52  *p++ = b;
53  }
54  return s;
55 }
56 
58 // HPACK encoder
59 //
60 
62  TrackCounters track_counters;
64  for (auto _ : state) {
67  }
68 
69  track_counters.Finish(state);
70 }
72 
74  TrackCounters track_counters;
77 
81  saved_now + grpc_core::Duration::Seconds(30));
82 
85  stats = {};
88  while (state.KeepRunning()) {
89  c.EncodeHeaders(
91  static_cast<uint32_t>(state.iterations()),
92  true,
93  false,
94  static_cast<size_t>(1024),
95  &stats,
96  },
97  b, &outbuf);
100  }
102 
103  std::ostringstream label;
104  label << "framing_bytes/iter:"
105  << (static_cast<double>(stats.framing_bytes) /
106  static_cast<double>(state.iterations()))
107  << " header_bytes/iter:"
108  << (static_cast<double>(stats.header_bytes) /
109  static_cast<double>(state.iterations()));
110  track_counters.AddLabel(label.str());
111  track_counters.Finish(state);
112 }
114 
115 template <class Fixture>
117  TrackCounters track_counters;
119  static bool logged_representative_output = false;
120 
122  grpc_metadata_batch b(arena.get());
123  Fixture::Prepare(&b);
124 
127  stats = {};
130  while (state.KeepRunning()) {
131  static constexpr int kEnsureMaxFrameAtLeast = 2;
132  c.EncodeHeaders(
134  static_cast<uint32_t>(state.iterations()),
135  state.range(0) != 0,
136  Fixture::kEnableTrueBinary,
137  static_cast<size_t>(state.range(1) + kEnsureMaxFrameAtLeast),
138  &stats,
139  },
140  b, &outbuf);
141  if (!logged_representative_output && state.iterations() > 3) {
142  logged_representative_output = true;
143  for (size_t i = 0; i < outbuf.count; i++) {
144  char* s = grpc_dump_slice(outbuf.slices[i], GPR_DUMP_HEX);
145  gpr_log(GPR_DEBUG, "%" PRIdPTR ": %s", i, s);
146  gpr_free(s);
147  }
148  }
151  }
153 
154  std::ostringstream label;
155  label << "framing_bytes/iter:"
156  << (static_cast<double>(stats.framing_bytes) /
157  static_cast<double>(state.iterations()))
158  << " header_bytes/iter:"
159  << (static_cast<double>(stats.header_bytes) /
160  static_cast<double>(state.iterations()));
161  track_counters.AddLabel(label.str());
162  track_counters.Finish(state);
163 }
164 
166 
167 class EmptyBatch {
168  public:
169  static constexpr bool kEnableTrueBinary = false;
170  static void Prepare(grpc_metadata_batch*) {}
171 };
172 
174  public:
175  static constexpr bool kEnableTrueBinary = false;
176  static void Prepare(grpc_metadata_batch* b) {
180  }
181 };
182 
184  abort();
185 }
186 
188  public:
189  static constexpr bool kEnableTrueBinary = false;
190  static void Prepare(grpc_metadata_batch* b) {
191  b->Append("abc", grpc_core::Slice::FromStaticString("def"),
193  }
194 };
195 
196 template <int kLength, bool kTrueBinary>
198  public:
199  static constexpr bool kEnableTrueBinary = kTrueBinary;
200  static void Prepare(grpc_metadata_batch* b) {
201  b->Append("abc-bin", MakeBytes(), CrashOnAppendError);
202  }
203 
204  private:
206  std::vector<char> v;
207  v.reserve(kLength);
208  for (int i = 0; i < kLength; i++) {
209  v.push_back(static_cast<char>(rand()));
210  }
212  }
213 };
214 
216  public:
217  static constexpr bool kEnableTrueBinary = true;
218  static void Prepare(grpc_metadata_batch* b) {
223  b->Set(
228  "foo.test.google.fr:1234")));
229  b->Set(
238  "grpc-c/3.0.0-dev (linux; chttp2; green)")));
239  }
240 };
241 
242 // This fixture reflects how initial metadata are sent by a production client,
243 // with non-indexed :path and binary headers. The metadata here are the same as
244 // the corresponding parser benchmark below.
246  public:
247  static constexpr bool kEnableTrueBinary = true;
248  static void Prepare(grpc_metadata_batch* b) {
255  "/grpc.test.FooService/BarMethod")));
258  "foo.test.google.fr:1234")));
261  "\x00\x01\x02\x03\x04\x05\x06\x07\x08"
262  "\x09\x0a\x0b\x0c\x0d\x0e\x0f"
263  "\x10\x11\x12\x13\x14\x15\x16\x17\x18"
264  "\x19\x1a\x1b\x1c\x1d\x1e\x1f"
265  "\x20\x21\x22\x23\x24\x25\x26\x27\x28"
266  "\x29\x2a\x2b\x2c\x2d\x2e\x2f"
267  "\x30")));
270  "\x00\x01\x02\x03\x04\x05\x06\x07\x08"
271  "\x09\x0a\x0b\x0c\x0d\x0e\x0f"
272  "\x10\x11\x12\x13")));
273  b->Set(
282  "grpc-c/3.0.0-dev (linux; chttp2; green)")));
283  }
284 };
285 
287  public:
288  static constexpr bool kEnableTrueBinary = true;
289  static void Prepare(grpc_metadata_batch* b) {
290  b->Set(grpc_core::HttpStatusMetadata(), 200);
293  b->Set(
297  }
298 };
299 
301  public:
302  static constexpr bool kEnableTrueBinary = true;
303  static void Prepare(grpc_metadata_batch* b) {
305  }
306 };
307 
309 // test with eof (shouldn't affect anything)
310 BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader, EmptyBatch)->Args({1, 16384});
312  ->Args({0, 16384});
314  ->Args({0, 16384});
315 BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader, SingleBinaryElem<1, false>)
316  ->Args({0, 16384});
317 BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader, SingleBinaryElem<3, false>)
318  ->Args({0, 16384});
319 BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader, SingleBinaryElem<10, false>)
320  ->Args({0, 16384});
321 BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader, SingleBinaryElem<31, false>)
322  ->Args({0, 16384});
323 BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader, SingleBinaryElem<100, false>)
324  ->Args({0, 16384});
325 // test with a tiny frame size, to highlight continuation costs
327  ->Args({0, 1});
328 
331  ->Args({0, 16384});
334  ->Args({0, 16384});
337  ->Args({0, 16384});
340  ->Args({1, 16384});
341 
342 } // namespace hpack_encoder_fixtures
343 
345 // HPACK parser
346 //
347 
349  TrackCounters track_counters;
351  for (auto _ : state) {
354  }
355 
356  track_counters.Finish(state);
357 }
359 
360 template <class Fixture>
362  TrackCounters track_counters;
363  std::vector<grpc_slice> init_slices = Fixture::GetInitSlices();
364  std::vector<grpc_slice> benchmark_slices = Fixture::GetBenchmarkSlices();
367  const int kArenaSize = 4096 * 4096;
370  b.Init(arena);
371  p.BeginFrame(&*b, std::numeric_limits<uint32_t>::max(),
376  auto parse_vec = [&p](const std::vector<grpc_slice>& slices) {
377  for (size_t i = 0; i < slices.size(); ++i) {
378  auto error = p.Parse(slices[i], i == slices.size() - 1);
380  }
381  };
382  parse_vec(init_slices);
383  while (state.KeepRunning()) {
384  b->Clear();
385  parse_vec(benchmark_slices);
387  // Recreate arena every 4k iterations to avoid oom
388  if (0 == (state.iterations() & 0xfff)) {
389  b.Destroy();
390  arena->Destroy();
392  b.Init(arena);
393  p.BeginFrame(&*b, std::numeric_limits<uint32_t>::max(),
398  }
399  }
400  // Clean up
401  b.Destroy();
402  for (auto slice : init_slices) grpc_slice_unref(slice);
403  for (auto slice : benchmark_slices) grpc_slice_unref(slice);
404  arena->Destroy();
405 
406  track_counters.Finish(state);
407 }
408 
410 
411 template <class EncoderFixture>
413  public:
414  static std::vector<grpc_slice> GetInitSlices() { return Generate(0); }
415  static std::vector<grpc_slice> GetBenchmarkSlices() { return Generate(1); }
416 
417  private:
418  static std::vector<grpc_slice> Generate(int iteration) {
420 
422  grpc_metadata_batch b(arena.get());
423  EncoderFixture::Prepare(&b);
424 
427  std::vector<grpc_slice> out;
428  stats = {};
429  bool done = false;
430  int i = 0;
431  while (!done) {
434  c.EncodeHeaders(
436  static_cast<uint32_t>(i),
437  false,
438  EncoderFixture::kEnableTrueBinary,
439  1024 * 1024,
440  &stats,
441  },
442  b, &outbuf);
443  if (i == iteration) {
444  for (size_t s = 0; s < outbuf.count; s++) {
445  out.push_back(grpc_slice_ref_internal(outbuf.slices[s]));
446  }
447  done = true;
448  }
452  i++;
453  }
454  // Remove the HTTP header.
455  GPR_ASSERT(!out.empty());
458  return out;
459  }
460 };
461 
462 class EmptyBatch {
463  public:
464  static std::vector<grpc_slice> GetInitSlices() { return {}; }
465  static std::vector<grpc_slice> GetBenchmarkSlices() {
466  return {MakeSlice({})};
467  }
468 };
469 
471  public:
472  static std::vector<grpc_slice> GetInitSlices() {
473  return {MakeSlice(
474  {0x40, 0x07, ':', 's', 't', 'a', 't', 'u', 's', 0x03, '2', '0', '0'})};
475  }
476  static std::vector<grpc_slice> GetBenchmarkSlices() {
477  return {MakeSlice({0xbe})};
478  }
479 };
480 
482  public:
483  static std::vector<grpc_slice> GetInitSlices() { return {}; }
484  static std::vector<grpc_slice> GetBenchmarkSlices() {
485  return {MakeSlice(
486  {0x40, 0x07, ':', 's', 't', 'a', 't', 'u', 's', 0x03, '2', '0', '0'})};
487  }
488 };
489 
491  public:
492  static std::vector<grpc_slice> GetInitSlices() {
493  return {MakeSlice(
494  {0x40, 0x07, ':', 's', 't', 'a', 't', 'u', 's', 0x03, '2', '0', '0'})};
495  }
496  static std::vector<grpc_slice> GetBenchmarkSlices() {
497  return {MakeSlice({0x7e, 0x03, '4', '0', '4'})};
498  }
499 };
500 
502  public:
503  static std::vector<grpc_slice> GetInitSlices() {
504  return {MakeSlice({0x40, 0x03, 'a', 'b', 'c', 0x03, 'd', 'e', 'f'})};
505  }
506  static std::vector<grpc_slice> GetBenchmarkSlices() {
507  return {MakeSlice({0xbe})};
508  }
509 };
510 
512  public:
513  static std::vector<grpc_slice> GetInitSlices() { return {}; }
514  static std::vector<grpc_slice> GetBenchmarkSlices() {
515  return {MakeSlice({0x40, 0x03, 'a', 'b', 'c', 0x03, 'd', 'e', 'f'})};
516  }
517 };
518 
520  public:
521  static std::vector<grpc_slice> GetInitSlices() {
522  return {MakeSlice({0x40, 0x03, 'a', 'b', 'c', 0x03, 'd', 'e', 'f'})};
523  }
524  static std::vector<grpc_slice> GetBenchmarkSlices() {
525  return {MakeSlice({0x7e, 0x03, 'g', 'h', 'i'})};
526  }
527 };
528 
530  public:
531  static std::vector<grpc_slice> GetInitSlices() { return {}; }
532  static std::vector<grpc_slice> GetBenchmarkSlices() {
533  return {MakeSlice({0x00, 0x03, 'a', 'b', 'c', 0x03, 'd', 'e', 'f'})};
534  }
535 };
536 
537 template <int kLength, bool kTrueBinary>
539 
540 template <int kLength>
541 class NonIndexedBinaryElem<kLength, true> {
542  public:
543  static std::vector<grpc_slice> GetInitSlices() { return {}; }
544  static std::vector<grpc_slice> GetBenchmarkSlices() {
545  std::vector<uint8_t> v = {
546  0x00, 0x07, 'a', 'b', 'c',
547  '-', 'b', 'i', 'n', static_cast<uint8_t>(kLength + 1),
548  0};
549  for (int i = 0; i < kLength; i++) {
550  v.push_back(static_cast<uint8_t>(i));
551  }
552  return {MakeSlice(v)};
553  }
554 };
555 
556 template <>
558  public:
559  static std::vector<grpc_slice> GetInitSlices() { return {}; }
560  static std::vector<grpc_slice> GetBenchmarkSlices() {
561  return {MakeSlice(
562  {0x00, 0x07, 'a', 'b', 'c', '-', 'b', 'i', 'n', 0x82, 0xf7, 0xb3})};
563  }
564 };
565 
566 template <>
568  public:
569  static std::vector<grpc_slice> GetInitSlices() { return {}; }
570  static std::vector<grpc_slice> GetBenchmarkSlices() {
571  return {MakeSlice({0x00, 0x07, 'a', 'b', 'c', '-', 'b', 'i', 'n', 0x84,
572  0x7f, 0x4e, 0x29, 0x3f})};
573  }
574 };
575 
576 template <>
578  public:
579  static std::vector<grpc_slice> GetInitSlices() { return {}; }
580  static std::vector<grpc_slice> GetBenchmarkSlices() {
581  return {MakeSlice({0x00, 0x07, 'a', 'b', 'c', '-', 'b',
582  'i', 'n', 0x8b, 0x71, 0x0c, 0xa5, 0x81,
583  0x73, 0x7b, 0x47, 0x13, 0xe9, 0xf7, 0xe3})};
584  }
585 };
586 
587 template <>
589  public:
590  static std::vector<grpc_slice> GetInitSlices() { return {}; }
591  static std::vector<grpc_slice> GetBenchmarkSlices() {
592  return {MakeSlice({0x00, 0x07, 'a', 'b', 'c', '-', 'b', 'i', 'n',
593  0xa3, 0x92, 0x43, 0x7f, 0xbe, 0x7c, 0xea, 0x6f, 0xf3,
594  0x3d, 0xa7, 0xa7, 0x67, 0xfb, 0xe2, 0x82, 0xf7, 0xf2,
595  0x8f, 0x1f, 0x9d, 0xdf, 0xf1, 0x7e, 0xb3, 0xef, 0xb2,
596  0x8f, 0x53, 0x77, 0xce, 0x0c, 0x13, 0xe3, 0xfd, 0x87})};
597  }
598 };
599 
600 template <>
602  public:
603  static std::vector<grpc_slice> GetInitSlices() { return {}; }
604  static std::vector<grpc_slice> GetBenchmarkSlices() {
605  return {MakeSlice(
606  {0x00, 0x07, 'a', 'b', 'c', '-', 'b', 'i', 'n', 0xeb, 0x1d, 0x4d,
607  0xe8, 0x96, 0x8c, 0x14, 0x20, 0x06, 0xc1, 0xc3, 0xdf, 0x6e, 0x1f, 0xef,
608  0xde, 0x2f, 0xde, 0xb7, 0xf2, 0xfe, 0x6d, 0xd4, 0xe4, 0x7d, 0xf5, 0x55,
609  0x46, 0x52, 0x3d, 0x91, 0xf2, 0xd4, 0x6f, 0xca, 0x34, 0xcd, 0xd9, 0x39,
610  0xbd, 0x03, 0x27, 0xe3, 0x9c, 0x74, 0xcc, 0x17, 0x34, 0xed, 0xa6, 0x6a,
611  0x77, 0x73, 0x10, 0xcd, 0x8e, 0x4e, 0x5c, 0x7c, 0x72, 0x39, 0xd8, 0xe6,
612  0x78, 0x6b, 0xdb, 0xa5, 0xb7, 0xab, 0xe7, 0x46, 0xae, 0x21, 0xab, 0x7f,
613  0x01, 0x89, 0x13, 0xd7, 0xca, 0x17, 0x6e, 0xcb, 0xd6, 0x79, 0x71, 0x68,
614  0xbf, 0x8a, 0x3f, 0x32, 0xe8, 0xba, 0xf5, 0xbe, 0xb3, 0xbc, 0xde, 0x28,
615  0xc7, 0xcf, 0x62, 0x7a, 0x58, 0x2c, 0xcf, 0x4d, 0xe3})};
616  }
617 };
618 
619 using RepresentativeClientInitialMetadata = FromEncoderFixture<
627 
628 // Send the same deadline repeatedly
630  public:
631  static std::vector<grpc_slice> GetInitSlices() {
632  return {
633  grpc_slice_from_static_string("@\x0cgrpc-timeout\x03"
634  "30S")};
635  }
636  static std::vector<grpc_slice> GetBenchmarkSlices() {
637  // Use saved key and literal value.
638  return {MakeSlice({0x0f, 0x2f, 0x03, '3', '0', 'S'})};
639  }
640 };
641 
643 BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, IndexedSingleStaticElem);
644 BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, AddIndexedSingleStaticElem);
645 BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, KeyIndexedSingleStaticElem);
646 BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, IndexedSingleInternedElem);
647 BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, AddIndexedSingleInternedElem);
648 BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, KeyIndexedSingleInternedElem);
650 BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<1, false>);
651 BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<3, false>);
652 BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<10, false>);
653 BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<31, false>);
654 BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<100, false>);
655 BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<1, true>);
656 BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<3, true>);
657 BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<10, true>);
658 BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<31, true>);
659 BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<100, true>);
675 
676 } // namespace hpack_parser_fixtures
677 
678 // Some distros have RunSpecifiedBenchmarks under the benchmark namespace,
679 // and others do not. This allows us to support both modes.
680 namespace benchmark {
682 } // namespace benchmark
683 
684 int main(int argc, char** argv) {
685  grpc::testing::TestEnvironment env(&argc, argv);
686  LibraryInitializer libInit;
687  ::benchmark::Initialize(&argc, argv);
688  grpc::testing::InitTest(&argc, &argv, false);
690  return 0;
691 }
hpack_parser_fixtures::KeyIndexedSingleInternedElem::GetBenchmarkSlices
static std::vector< grpc_slice > GetBenchmarkSlices()
Definition: bm_chttp2_hpack.cc:524
grpc_core::HPackParser::LogInfo
Definition: hpack_parser.h:59
hpack_encoder_fixtures::SingleStaticElem::Prepare
static void Prepare(grpc_metadata_batch *b)
Definition: bm_chttp2_hpack.cc:176
hpack_parser_fixtures::AddIndexedSingleStaticElem
Definition: bm_chttp2_hpack.cc:481
grpc::testing::InitTest
void InitTest(int *argc, char ***argv, bool remove_flags)
Definition: test_config_cc.cc:28
grpc_slice_unref
GPRAPI void grpc_slice_unref(grpc_slice s)
Definition: slice_api.cc:32
grpc_core::MakeScopedArena
ScopedArenaPtr MakeScopedArena(size_t initial_size, MemoryAllocator *memory_allocator)
Definition: src/core/lib/resource_quota/arena.h:130
BENCHMARK
BENCHMARK(BM_HpackEncoderInitDestroy)
GRPC_COMPRESS_DEFLATE
@ GRPC_COMPRESS_DEFLATE
Definition: compression_types.h:62
grpc_core::GrpcTimeoutMetadata
Definition: metadata_batch.h:59
gen_build_yaml.out
dictionary out
Definition: src/benchmark/gen_build_yaml.py:24
hpack_encoder_fixtures::EmptyBatch
Definition: bm_chttp2_hpack.cc:167
grpc_core::Arena::Create
static Arena * Create(size_t initial_size, MemoryAllocator *memory_allocator)
Definition: src/core/lib/resource_quota/arena.cc:58
log.h
hpack_parser_fixtures::NonIndexedBinaryElem< 3, false >::GetInitSlices
static std::vector< grpc_slice > GetInitSlices()
Definition: bm_chttp2_hpack.cc:569
hpack_parser_fixtures::NonIndexedBinaryElem< 3, false >::GetBenchmarkSlices
static std::vector< grpc_slice > GetBenchmarkSlices()
Definition: bm_chttp2_hpack.cc:570
metadata_batch.h
hpack_parser_fixtures::RepresentativeServerInitialMetadata
FromEncoderFixture< hpack_encoder_fixtures::RepresentativeServerInitialMetadata > RepresentativeServerInitialMetadata
Definition: bm_chttp2_hpack.cc:622
hpack_encoder_fixtures::SingleBinaryElem
Definition: bm_chttp2_hpack.cc:197
grpc_slice_ref_internal
const grpc_slice & grpc_slice_ref_internal(const grpc_slice &slice)
Definition: slice_refcount.h:32
hpack_encoder_fixtures::MoreRepresentativeClientInitialMetadata::Prepare
static void Prepare(grpc_metadata_batch *b)
Definition: bm_chttp2_hpack.cc:248
benchmark
Definition: bm_alarm.cc:55
generate.env
env
Definition: generate.py:37
hpack_parser_fixtures::SameDeadline::GetInitSlices
static std::vector< grpc_slice > GetInitSlices()
Definition: bm_chttp2_hpack.cc:631
hpack_parser_fixtures::BENCHMARK_TEMPLATE
BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, EmptyBatch)
grpc_event_engine::experimental::MemoryAllocator
Definition: memory_allocator.h:35
grpc_dump_slice
char * grpc_dump_slice(const grpc_slice &s, uint32_t flags)
Definition: slice_string_helpers.cc:25
hpack_parser_fixtures::NonIndexedBinaryElem< 10, false >::GetBenchmarkSlices
static std::vector< grpc_slice > GetBenchmarkSlices()
Definition: bm_chttp2_hpack.cc:580
grpc_core::CompressionAlgorithmSet
Definition: compression_internal.h:52
slice.h
false
#define false
Definition: setup_once.h:323
hpack_parser_fixtures
Definition: bm_chttp2_hpack.cc:409
grpc_core::HttpMethodMetadata
Definition: metadata_batch.h:136
hpack_encoder_fixtures::SingleBinaryElem::Prepare
static void Prepare(grpc_metadata_batch *b)
Definition: bm_chttp2_hpack.cc:200
main
int main(int argc, char **argv)
Definition: bm_chttp2_hpack.cc:684
grpc_core::Slice
Definition: src/core/lib/slice/slice.h:282
grpc_core::HttpPathMetadata
Definition: metadata_batch.h:262
string.h
outbuf
unsigned char outbuf[SIZE]
Definition: bloaty/third_party/zlib/examples/gun.c:162
grpc_core::slice_detail::StaticConstructors< Slice >::FromStaticString
static Slice FromStaticString(const char *s)
Definition: src/core/lib/slice/slice.h:201
absl::string_view
Definition: abseil-cpp/absl/strings/string_view.h:167
grpc_core::Timestamp
Definition: src/core/lib/gprpp/time.h:62
gpr_free
GPRAPI void gpr_free(void *ptr)
Definition: alloc.cc:51
error
grpc_error_handle error
Definition: retry_filter.cc:499
grpc_core::HttpSchemeMetadata::kHttp
@ kHttp
Definition: metadata_batch.h:117
BM_HpackEncoderEncodeDeadline
static void BM_HpackEncoderEncodeDeadline(benchmark::State &state)
Definition: bm_chttp2_hpack.cc:73
hpack_encoder_fixtures::RepresentativeServerInitialMetadata
Definition: bm_chttp2_hpack.cc:286
grpc_core::HPackParser
Definition: hpack_parser.h:40
benchmark::RunTheBenchmarksNamespaced
void RunTheBenchmarksNamespaced()
Definition: bm_alarm.cc:56
hpack_parser_fixtures::KeyIndexedSingleStaticElem
Definition: bm_chttp2_hpack.cc:490
hpack_parser_fixtures::AddIndexedSingleStaticElem::GetInitSlices
static std::vector< grpc_slice > GetInitSlices()
Definition: bm_chttp2_hpack.cc:483
grpc_core::HttpStatusMetadata
Definition: metadata_batch.h:320
xds_manager.p
p
Definition: xds_manager.py:60
grpc_core::GrpcAcceptEncodingMetadata
Definition: metadata_batch.h:187
GPR_DUMP_HEX
#define GPR_DUMP_HEX
Definition: string.h:34
TrackCounters::Finish
virtual void Finish(benchmark::State &state)
Definition: helpers.cc:44
grpc_slice_sub_no_ref
GPRAPI grpc_slice grpc_slice_sub_no_ref(grpc_slice s, size_t begin, size_t end)
Definition: slice/slice.cc:264
hpack_encoder_fixtures::EmptyBatch::kEnableTrueBinary
static constexpr bool kEnableTrueBinary
Definition: bm_chttp2_hpack.cc:169
uint8_t
unsigned char uint8_t
Definition: stdint-msvc2008.h:78
hpack_encoder_fixtures::SingleStaticElem
Definition: bm_chttp2_hpack.cc:173
GRPC_COMPRESS_NONE
@ GRPC_COMPRESS_NONE
Definition: compression_types.h:61
grpc_core::TeMetadata
Definition: metadata_batch.h:71
grpc_slice_malloc
GPRAPI grpc_slice grpc_slice_malloc(size_t length)
Definition: slice/slice.cc:227
grpc_core::HPackParser::Boundary::None
@ None
true
#define true
Definition: setup_once.h:324
hpack_parser_fixtures::IndexedSingleStaticElem::GetInitSlices
static std::vector< grpc_slice > GetInitSlices()
Definition: bm_chttp2_hpack.cc:472
arena
grpc_core::ScopedArenaPtr arena
Definition: binder_transport_test.cc:237
hpack_encoder_fixtures::RepresentativeServerInitialMetadata::kEnableTrueBinary
static constexpr bool kEnableTrueBinary
Definition: bm_chttp2_hpack.cc:288
hpack_parser_fixtures::IndexedSingleInternedElem::GetBenchmarkSlices
static std::vector< grpc_slice > GetBenchmarkSlices()
Definition: bm_chttp2_hpack.cc:506
grpc_core::HPackCompressor::EncodeHeaderOptions
Definition: hpack_encoder.h:68
timeout_encoding.h
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
hpack_parser_fixtures::EmptyBatch::GetInitSlices
static std::vector< grpc_slice > GetInitSlices()
Definition: bm_chttp2_hpack.cc:464
hpack_parser_fixtures::IndexedSingleStaticElem::GetBenchmarkSlices
static std::vector< grpc_slice > GetBenchmarkSlices()
Definition: bm_chttp2_hpack.cc:476
hpack_parser_fixtures::NonIndexedElem::GetInitSlices
static std::vector< grpc_slice > GetInitSlices()
Definition: bm_chttp2_hpack.cc:531
TrackCounters
Definition: helpers.h:51
benchmark::RunSpecifiedBenchmarks
size_t RunSpecifiedBenchmarks()
Definition: benchmark/src/benchmark.cc:437
hpack_encoder_fixtures::SingleNonBinaryElem::Prepare
static void Prepare(grpc_metadata_batch *b)
Definition: bm_chttp2_hpack.cc:190
hpack_parser_fixtures::FromEncoderFixture
Definition: bm_chttp2_hpack.cc:412
c
void c(T a)
Definition: miscompile_with_no_unique_address_test.cc:40
hpack_parser.h
GRPC_STATUS_OK
@ GRPC_STATUS_OK
Definition: include/grpc/impl/codegen/status.h:30
GPR_ASSERT
#define GPR_ASSERT(x)
Definition: include/grpc/impl/codegen/log.h:94
grpc_core::HPackCompressor
Definition: hpack_encoder.h:51
gen_synthetic_protos.label
label
Definition: gen_synthetic_protos.py:102
hpack_parser_fixtures::KeyIndexedSingleInternedElem::GetInitSlices
static std::vector< grpc_slice > GetInitSlices()
Definition: bm_chttp2_hpack.cc:521
hpack_encoder_fixtures::SingleBinaryElem::MakeBytes
static grpc_core::Slice MakeBytes()
Definition: bm_chttp2_hpack.cc:205
max
int max
Definition: bloaty/third_party/zlib/examples/enough.c:170
hpack_parser_fixtures::KeyIndexedSingleInternedElem
Definition: bm_chttp2_hpack.cc:519
grpc_core::GrpcTagsBinMetadata
Definition: metadata_batch.h:250
grpc_core::ExecCtx::Flush
bool Flush()
Definition: exec_ctx.cc:69
grpc_core::slice_detail::CopyConstructors< Slice >::FromCopiedBuffer
static Slice FromCopiedBuffer(const char *p, size_t len)
Definition: src/core/lib/slice/slice.h:182
RepresentativeClientInitialMetadata
Definition: bm_chttp2_transport.cc:295
grpc_core::HttpAuthorityMetadata
Definition: metadata_batch.h:256
slice
grpc_slice slice
Definition: src/core/lib/surface/server.cc:467
gpr_log
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
setup.v
v
Definition: third_party/bloaty/third_party/capstone/bindings/python/setup.py:42
hpack_encoder_fixtures::MoreRepresentativeClientInitialMetadata
Definition: bm_chttp2_hpack.cc:245
gmock_output_test._
_
Definition: bloaty/third_party/googletest/googlemock/test/gmock_output_test.py:175
gen_stats_data.stats
list stats
Definition: gen_stats_data.py:58
g_memory_allocator
static auto * g_memory_allocator
Definition: bm_chttp2_hpack.cc:44
hpack_encoder_fixtures::EmptyBatch::Prepare
static void Prepare(grpc_metadata_batch *)
Definition: bm_chttp2_hpack.cc:170
done
struct tab * done
Definition: bloaty/third_party/zlib/examples/enough.c:176
GRPC_SLICE_START_PTR
#define GRPC_SLICE_START_PTR(slice)
Definition: include/grpc/impl/codegen/slice.h:101
hpack_encoder_fixtures::RepresentativeServerTrailingMetadata::kEnableTrueBinary
static constexpr bool kEnableTrueBinary
Definition: bm_chttp2_hpack.cc:302
grpc_slice_from_static_string
GPRAPI grpc_slice grpc_slice_from_static_string(const char *source)
Definition: slice/slice.cc:89
time.h
grpc_slice
Definition: include/grpc/impl/codegen/slice.h:65
hpack_parser_fixtures::AddIndexedSingleStaticElem::GetBenchmarkSlices
static std::vector< grpc_slice > GetBenchmarkSlices()
Definition: bm_chttp2_hpack.cc:484
hpack_encoder_fixtures::SingleStaticElem::kEnableTrueBinary
static constexpr bool kEnableTrueBinary
Definition: bm_chttp2_hpack.cc:175
grpc_core::ResourceQuota::Default
static ResourceQuotaRefPtr Default()
Definition: resource_quota.cc:27
grpc_core::UserAgentMetadata
Definition: metadata_batch.h:214
grpc_core::TeMetadata::kTrailers
@ kTrailers
Definition: metadata_batch.h:77
benchmark::Initialize
void Initialize(int *argc, char **argv)
Definition: benchmark/src/benchmark.cc:602
hpack_encoder_fixtures::RepresentativeClientInitialMetadata::Prepare
static void Prepare(grpc_metadata_batch *b)
Definition: bm_chttp2_hpack.cc:218
slice_internal.h
b
uint64_t b
Definition: abseil-cpp/absl/container/internal/layout_test.cc:53
helpers.h
resource_quota.h
grpc_transport_one_way_stats
Definition: transport.h:243
hpack_encoder_fixtures::RepresentativeClientInitialMetadata
Definition: bm_chttp2_hpack.cc:215
grpc_core::ExecCtx
Definition: exec_ctx.h:97
grpc_core::GrpcStatusMetadata
Definition: metadata_batch.h:293
grpc_slice_buffer_init
GPRAPI void grpc_slice_buffer_init(grpc_slice_buffer *sb)
Definition: slice/slice_buffer.cc:116
LibraryInitializer
Definition: helpers.h:33
GRPC_SLICE_LENGTH
#define GRPC_SLICE_LENGTH(slice)
Definition: include/grpc/impl/codegen/slice.h:104
hpack_encoder_fixtures::BENCHMARK_TEMPLATE
BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader, EmptyBatch) -> Args(
Definition: bm_chttp2_hpack.cc:308
hpack_parser_fixtures::IndexedSingleInternedElem::GetInitSlices
static std::vector< grpc_slice > GetInitSlices()
Definition: bm_chttp2_hpack.cc:503
hpack_parser_fixtures::AddIndexedSingleInternedElem::GetInitSlices
static std::vector< grpc_slice > GetInitSlices()
Definition: bm_chttp2_hpack.cc:513
hpack_parser_fixtures::FromEncoderFixture::GetInitSlices
static std::vector< grpc_slice > GetInitSlices()
Definition: bm_chttp2_hpack.cc:414
test_config.h
BM_HpackParserInitDestroy
static void BM_HpackParserInitDestroy(benchmark::State &state)
Definition: bm_chttp2_hpack.cc:348
hpack_parser_fixtures::NonIndexedBinaryElem
Definition: bm_chttp2_hpack.cc:538
hpack_encoder_fixtures::MoreRepresentativeClientInitialMetadata::kEnableTrueBinary
static constexpr bool kEnableTrueBinary
Definition: bm_chttp2_hpack.cc:247
TrackCounters::AddLabel
virtual void AddLabel(const std::string &label)
Definition: helpers.cc:57
hpack_parser_fixtures::SameDeadline::GetBenchmarkSlices
static std::vector< grpc_slice > GetBenchmarkSlices()
Definition: bm_chttp2_hpack.cc:636
hpack_encoder_fixtures::RepresentativeServerTrailingMetadata::Prepare
static void Prepare(grpc_metadata_batch *b)
Definition: bm_chttp2_hpack.cc:303
hpack_encoder_fixtures::RepresentativeClientInitialMetadata::kEnableTrueBinary
static constexpr bool kEnableTrueBinary
Definition: bm_chttp2_hpack.cc:217
bytes
uint8 bytes[10]
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream_unittest.cc:153
hpack_parser_fixtures::AddIndexedSingleInternedElem::GetBenchmarkSlices
static std::vector< grpc_slice > GetBenchmarkSlices()
Definition: bm_chttp2_hpack.cc:514
BM_HpackEncoderEncodeHeader
static void BM_HpackEncoderEncodeHeader(benchmark::State &state)
Definition: bm_chttp2_hpack.cc:116
BM_HpackEncoderInitDestroy
static void BM_HpackEncoderInitDestroy(benchmark::State &state)
Definition: bm_chttp2_hpack.cc:61
hpack_parser_fixtures::NonIndexedElem::GetBenchmarkSlices
static std::vector< grpc_slice > GetBenchmarkSlices()
Definition: bm_chttp2_hpack.cc:532
grpc_core::HttpSchemeMetadata
Definition: metadata_batch.h:114
hpack_parser_fixtures::NonIndexedBinaryElem< 1, false >::GetInitSlices
static std::vector< grpc_slice > GetInitSlices()
Definition: bm_chttp2_hpack.cc:559
grpc_core::HPackParser::Priority::None
@ None
hpack_parser_fixtures::NonIndexedBinaryElem< 31, false >::GetInitSlices
static std::vector< grpc_slice > GetInitSlices()
Definition: bm_chttp2_hpack.cc:590
exec_ctx
grpc_core::ExecCtx exec_ctx
Definition: end2end_binder_transport_test.cc:75
grpc_core::HttpMethodMetadata::kPost
@ kPost
Definition: metadata_batch.h:139
hpack_parser_fixtures::NonIndexedBinaryElem< 100, false >::GetBenchmarkSlices
static std::vector< grpc_slice > GetBenchmarkSlices()
Definition: bm_chttp2_hpack.cc:604
hpack_encoder_fixtures
Definition: bm_chttp2_hpack.cc:165
hpack_parser_fixtures::RepresentativeServerTrailingMetadata
FromEncoderFixture< hpack_encoder_fixtures::RepresentativeServerTrailingMetadata > RepresentativeServerTrailingMetadata
Definition: bm_chttp2_hpack.cc:624
benchmark::State
Definition: benchmark/include/benchmark/benchmark.h:503
alloc.h
hpack_encoder_fixtures::SingleNonBinaryElem::kEnableTrueBinary
static constexpr bool kEnableTrueBinary
Definition: bm_chttp2_hpack.cc:189
hpack_parser_fixtures::NonIndexedBinaryElem< 10, false >::GetInitSlices
static std::vector< grpc_slice > GetInitSlices()
Definition: bm_chttp2_hpack.cc:579
grpc::testing::TestEnvironment
Definition: test/core/util/test_config.h:54
GRPC_COMPRESS_GZIP
@ GRPC_COMPRESS_GZIP
Definition: compression_types.h:63
grpc_core::Duration::Seconds
static constexpr Duration Seconds(int64_t seconds)
Definition: src/core/lib/gprpp/time.h:151
hpack_parser_fixtures::NonIndexedBinaryElem< 1, false >::GetBenchmarkSlices
static std::vector< grpc_slice > GetBenchmarkSlices()
Definition: bm_chttp2_hpack.cc:560
hpack_encoder_fixtures::RepresentativeServerTrailingMetadata
Definition: bm_chttp2_hpack.cc:300
slices
SliceBuffer * slices
Definition: retry_filter.cc:631
hpack_parser_fixtures::AddIndexedSingleInternedElem
Definition: bm_chttp2_hpack.cc:511
hpack_encoder.h
hpack_encoder_fixtures::SingleBinaryElem::kEnableTrueBinary
static constexpr bool kEnableTrueBinary
Definition: bm_chttp2_hpack.cc:199
state
Definition: bloaty/third_party/zlib/contrib/blast/blast.c:41
hpack_parser_fixtures::SameDeadline
Definition: bm_chttp2_hpack.cc:629
test_config.h
hpack_parser_fixtures::KeyIndexedSingleStaticElem::GetInitSlices
static std::vector< grpc_slice > GetInitSlices()
Definition: bm_chttp2_hpack.cc:492
hpack_parser_fixtures::IndexedSingleInternedElem
Definition: bm_chttp2_hpack.cc:501
hpack_parser_fixtures::MoreRepresentativeClientInitialMetadata
FromEncoderFixture< hpack_encoder_fixtures::MoreRepresentativeClientInitialMetadata > MoreRepresentativeClientInitialMetadata
Definition: bm_chttp2_hpack.cc:626
grpc_slice_buffer_destroy_internal
void grpc_slice_buffer_destroy_internal(grpc_slice_buffer *sb)
Definition: slice/slice_buffer.cc:123
hpack_parser_fixtures::NonIndexedElem
Definition: bm_chttp2_hpack.cc:529
hpack_parser_fixtures::IndexedSingleStaticElem
Definition: bm_chttp2_hpack.cc:470
grpc_core::ContentTypeMetadata::kApplicationGrpc
@ kApplicationGrpc
Definition: metadata_batch.h:98
hpack_parser_fixtures::EmptyBatch
Definition: bm_chttp2_hpack.cc:462
GPR_DEBUG
#define GPR_DEBUG
Definition: include/grpc/impl/codegen/log.h:55
hpack_parser_fixtures::NonIndexedBinaryElem< 31, false >::GetBenchmarkSlices
static std::vector< grpc_slice > GetBenchmarkSlices()
Definition: bm_chttp2_hpack.cc:591
BM_HpackParserParseHeader
static void BM_HpackParserParseHeader(benchmark::State &state)
Definition: bm_chttp2_hpack.cc:361
grpc_core::ContentTypeMetadata
Definition: metadata_batch.h:92
hpack_parser_fixtures::FromEncoderFixture::GetBenchmarkSlices
static std::vector< grpc_slice > GetBenchmarkSlices()
Definition: bm_chttp2_hpack.cc:415
grpc_slice_buffer
Definition: include/grpc/impl/codegen/slice.h:83
hpack_parser_fixtures::NonIndexedBinaryElem< kLength, true >::GetBenchmarkSlices
static std::vector< grpc_slice > GetBenchmarkSlices()
Definition: bm_chttp2_hpack.cc:544
grpc_core::ExecCtx::Now
Timestamp Now()
Definition: exec_ctx.cc:90
MakeSlice
static grpc_slice MakeSlice(const std::vector< uint8_t > &bytes)
Definition: bm_chttp2_hpack.cc:48
hpack_parser_fixtures::FromEncoderFixture::Generate
static std::vector< grpc_slice > Generate(int iteration)
Definition: bm_chttp2_hpack.cc:418
grpc_core::HPackParser::LogInfo::kHeaders
@ kHeaders
Definition: hpack_parser.h:64
grpc_metadata_batch
Definition: metadata_batch.h:1259
hpack_encoder_fixtures::SingleNonBinaryElem
Definition: bm_chttp2_hpack.cc:187
hpack_encoder_fixtures::RepresentativeServerInitialMetadata::Prepare
static void Prepare(grpc_metadata_batch *b)
Definition: bm_chttp2_hpack.cc:289
hpack_parser_fixtures::EmptyBatch::GetBenchmarkSlices
static std::vector< grpc_slice > GetBenchmarkSlices()
Definition: bm_chttp2_hpack.cc:465
hpack_parser_fixtures::NonIndexedBinaryElem< 100, false >::GetInitSlices
static std::vector< grpc_slice > GetInitSlices()
Definition: bm_chttp2_hpack.cc:603
grpc_core::GrpcTraceBinMetadata
Definition: metadata_batch.h:244
grpc_slice_buffer_reset_and_unref_internal
void grpc_slice_buffer_reset_and_unref_internal(grpc_slice_buffer *sb)
Definition: slice/slice_buffer.cc:238
grpc_core::ExecCtx::Get
static ExecCtx * Get()
Definition: exec_ctx.h:205
hpack_parser_fixtures::KeyIndexedSingleStaticElem::GetBenchmarkSlices
static std::vector< grpc_slice > GetBenchmarkSlices()
Definition: bm_chttp2_hpack.cc:496
slice_string_helpers.h
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
hpack_encoder_fixtures::CrashOnAppendError
static void CrashOnAppendError(absl::string_view, const grpc_core::Slice &)
Definition: bm_chttp2_hpack.cc:183
hpack_parser_fixtures::NonIndexedBinaryElem< kLength, true >::GetInitSlices
static std::vector< grpc_slice > GetInitSlices()
Definition: bm_chttp2_hpack.cc:543
GRPC_ERROR_IS_NONE
#define GRPC_ERROR_IS_NONE(err)
Definition: error.h:241
grpc_core::ManualConstructor
Definition: manual_constructor.h:103


grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:48