|
|
@ -64,11 +64,11 @@ BENCHMARK(BM_HpackEncoderInitDestroy); |
|
|
|
static void BM_HpackEncoderEncodeDeadline(benchmark::State &state) { |
|
|
|
static void BM_HpackEncoderEncodeDeadline(benchmark::State &state) { |
|
|
|
TrackCounters track_counters; |
|
|
|
TrackCounters track_counters; |
|
|
|
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; |
|
|
|
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; |
|
|
|
|
|
|
|
grpc_millis saved_now = grpc_exec_ctx_now(&exec_ctx); |
|
|
|
|
|
|
|
|
|
|
|
grpc_metadata_batch b; |
|
|
|
grpc_metadata_batch b; |
|
|
|
grpc_metadata_batch_init(&b); |
|
|
|
grpc_metadata_batch_init(&b); |
|
|
|
b.deadline = gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), |
|
|
|
b.deadline = saved_now + 30 * 1000; |
|
|
|
gpr_time_from_seconds(30, GPR_TIMESPAN)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
grpc_chttp2_hpack_compressor c; |
|
|
|
grpc_chttp2_hpack_compressor c; |
|
|
|
grpc_chttp2_hpack_compressor_init(&c); |
|
|
|
grpc_chttp2_hpack_compressor_init(&c); |
|
|
@ -280,9 +280,9 @@ class MoreRepresentativeClientInitialMetadata { |
|
|
|
static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) { |
|
|
|
static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) { |
|
|
|
return { |
|
|
|
return { |
|
|
|
GRPC_MDELEM_SCHEME_HTTP, GRPC_MDELEM_METHOD_POST, |
|
|
|
GRPC_MDELEM_SCHEME_HTTP, GRPC_MDELEM_METHOD_POST, |
|
|
|
grpc_mdelem_from_slices( |
|
|
|
grpc_mdelem_from_slices(exec_ctx, GRPC_MDSTR_PATH, |
|
|
|
exec_ctx, GRPC_MDSTR_PATH, |
|
|
|
grpc_slice_intern(grpc_slice_from_static_string( |
|
|
|
grpc_slice_from_static_string("/grpc.test.FooService/BarMethod")), |
|
|
|
"/grpc.test.FooService/BarMethod"))), |
|
|
|
grpc_mdelem_from_slices(exec_ctx, GRPC_MDSTR_AUTHORITY, |
|
|
|
grpc_mdelem_from_slices(exec_ctx, GRPC_MDSTR_AUTHORITY, |
|
|
|
grpc_slice_intern(grpc_slice_from_static_string( |
|
|
|
grpc_slice_intern(grpc_slice_from_static_string( |
|
|
|
"foo.test.google.fr:1234"))), |
|
|
|
"foo.test.google.fr:1234"))), |
|
|
@ -667,17 +667,17 @@ class MoreRepresentativeClientInitialMetadata { |
|
|
|
return {MakeSlice( |
|
|
|
return {MakeSlice( |
|
|
|
{0x40, 0x07, ':', 's', 'c', 'h', 'e', 'm', 'e', 0x04, 'h', 't', |
|
|
|
{0x40, 0x07, ':', 's', 'c', 'h', 'e', 'm', 'e', 0x04, 'h', 't', |
|
|
|
't', 'p', 0x40, 0x07, ':', 'm', 'e', 't', 'h', 'o', 'd', 0x04, |
|
|
|
't', 'p', 0x40, 0x07, ':', 'm', 'e', 't', 'h', 'o', 'd', 0x04, |
|
|
|
'P', 'O', 'S', 'T', 0x00, 0x05, ':', 'p', 'a', 't', 'h', 0x1f, |
|
|
|
'P', 'O', 'S', 'T', 0x40, 0x05, ':', 'p', 'a', 't', 'h', 0x1f, |
|
|
|
'/', 'g', 'r', 'p', 'c', '.', 't', 'e', 's', 't', '.', 'F', |
|
|
|
'/', 'g', 'r', 'p', 'c', '.', 't', 'e', 's', 't', '.', 'F', |
|
|
|
'o', 'o', 'S', 'e', 'r', 'v', 'i', 'c', 'e', '/', 'B', 'a', |
|
|
|
'o', 'o', 'S', 'e', 'r', 'v', 'i', 'c', 'e', '/', 'B', 'a', |
|
|
|
'r', 'M', 'e', 't', 'h', 'o', 'd', 0x40, 0x0a, ':', 'a', 'u', |
|
|
|
'r', 'M', 'e', 't', 'h', 'o', 'd', 0x40, 0x0a, ':', 'a', 'u', |
|
|
|
't', 'h', 'o', 'r', 'i', 't', 'y', 0x09, 'l', 'o', 'c', 'a', |
|
|
|
't', 'h', 'o', 'r', 'i', 't', 'y', 0x09, 'l', 'o', 'c', 'a', |
|
|
|
'l', 'h', 'o', 's', 't', 0x00, 0x0e, 'g', 'r', 'p', 'c', '-', |
|
|
|
'l', 'h', 'o', 's', 't', 0x40, 0x0e, 'g', 'r', 'p', 'c', '-', |
|
|
|
't', 'r', 'a', 'c', 'e', '-', 'b', 'i', 'n', 0x31, 0x00, 0x01, |
|
|
|
't', 'r', 'a', 'c', 'e', '-', 'b', 'i', 'n', 0x31, 0x00, 0x01, |
|
|
|
0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, |
|
|
|
0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, |
|
|
|
0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, |
|
|
|
0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, |
|
|
|
0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, |
|
|
|
0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, |
|
|
|
0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x00, |
|
|
|
0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x40, |
|
|
|
0x0d, 'g', 'r', 'p', 'c', '-', 't', 'a', 'g', 's', '-', 'b', |
|
|
|
0x0d, 'g', 'r', 'p', 'c', '-', 't', 'a', 'g', 's', '-', 'b', |
|
|
|
'i', 'n', 0x14, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, |
|
|
|
'i', 'n', 0x14, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, |
|
|
|
0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x40, |
|
|
|
0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x40, |
|
|
@ -696,19 +696,13 @@ class MoreRepresentativeClientInitialMetadata { |
|
|
|
} |
|
|
|
} |
|
|
|
static std::vector<grpc_slice> GetBenchmarkSlices() { |
|
|
|
static std::vector<grpc_slice> GetBenchmarkSlices() { |
|
|
|
return {MakeSlice( |
|
|
|
return {MakeSlice( |
|
|
|
{0xc4, 0xc3, 0x00, 0x05, ':', 'p', 'a', 't', 'h', 0x1f, '/', 'g', |
|
|
|
{0xc7, 0xc6, 0xc5, 0xc4, 0x7f, 0x04, 0x31, 0x00, 0x01, 0x02, 0x03, 0x04, |
|
|
|
'r', 'p', 'c', '.', 't', 'e', 's', 't', '.', 'F', 'o', 'o', |
|
|
|
0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, |
|
|
|
'S', 'e', 'r', 'v', 'i', 'c', 'e', '/', 'B', 'a', 'r', 'M', |
|
|
|
0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, |
|
|
|
'e', 't', 'h', 'o', 'd', 0xc2, 0x00, 0x0e, 'g', 'r', 'p', 'c', |
|
|
|
0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, |
|
|
|
'-', 't', 'r', 'a', 'c', 'e', '-', 'b', 'i', 'n', 0x31, 0x00, |
|
|
|
0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x7f, 0x03, 0x14, 0x00, |
|
|
|
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, |
|
|
|
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, |
|
|
|
0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, |
|
|
|
0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0xc1, 0xc0, 0xbf, 0xbe})}; |
|
|
|
0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, |
|
|
|
|
|
|
|
0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, |
|
|
|
|
|
|
|
0x00, 0x0d, 'g', 'r', 'p', 'c', '-', 't', 'a', 'g', 's', '-', |
|
|
|
|
|
|
|
'b', 'i', 'n', 0x14, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, |
|
|
|
|
|
|
|
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, |
|
|
|
|
|
|
|
0xc1, 0xc0, 0xbf, 0xbe})}; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|