grpc/test/cpp/microbenchmarks
Arjun Roy 557446a11e Added specializations for grpc_mdelem_create.
In several cases, we create grpc mdelem structures using known-static
metadata inputs. Furthermore, in several cases we create a slice on
the heap (e.g. grpc_slice_from_copied_buffer) where we know we are
transferring refcount ownership. In several cases, then, we can:

1) Avoid unnecessary ref/unref operations that are no-ops (for static
   slices) or superfluous (if we're transferring ownership).
2) Avoid unnecessarily comprehensive calls to grpc_slice_eq (since
   they'd only be called with static or interned slice arguments,
   which by construction would have equal refcounts if they were
   in fact equal.
3) Avoid unnecessary checks to see if a slice is interned (when we
   know that they are).

To avoid polluting the internal API, we introduce the notion of
strongly-typed grpc_slice objects. We draw a distinction between
Internal (interned and static-storage) slices and Extern (inline and
non-statically allocated). We introduce overloads to
grpc_mdelem_create() and grpc_mdelem_from_slices() for the fastpath
cases identified above based on these slice types.

From the programmer's point of view, though, nothing changes - they
need only use grpc_mdelem_create() and grpc_mdelem_from_slices() as
before, and the appropriate fastpath will be picked based on type
inference. If no special knowledge exists for the slice type (i.e. we
pass in generic grpc_slice objects), the slowpath method will still
always return correct behaviour.

This is good for:
- Roughly 1-3% reduction in CPU time for several unary/streaming
  ping pong fullstack microbenchmarks.
- Reduction of about 15-20% in CPU time for some hpack parser
  microbenchmarks.
- 10-12% reduction of CPU time for metadata microbenchmarks involving
  interned slice comparisons.
2019-07-30 17:07:44 -07:00
..
BUILD Add threadpool benchmark and build files 2019-07-19 10:23:22 -07:00
bm_alarm.cc Made gRPC inialized after entering main function in microbenchmarks. 2019-05-02 16:58:37 -07:00
bm_arena.cc Shrink arena size by 40 bytes and add additional 2019-04-24 16:39:03 -07:00
bm_byte_buffer.cc Made gRPC inialized after entering main function in microbenchmarks. 2019-05-02 16:58:37 -07:00
bm_call_create.cc Revert "Merge pull request #19686 from gnossen/revert_breakage" 2019-07-23 07:50:27 -07:00
bm_callback_streaming_ping_pong.cc Clang format 2019-05-06 09:18:29 -07:00
bm_callback_unary_ping_pong.cc Clang format 2019-05-06 09:18:29 -07:00
bm_channel.cc Made gRPC inialized after entering main function in microbenchmarks. 2019-05-02 16:58:37 -07:00
bm_chttp2_hpack.cc Removed duplicate static table from hpack table. Removed an or instruction for 2019-07-15 15:39:31 -07:00
bm_chttp2_transport.cc Heap allocate the stream object for other benchmark cases too 2019-06-14 14:44:49 -07:00
bm_closure.cc Made gRPC inialized after entering main function in microbenchmarks. 2019-05-02 16:58:37 -07:00
bm_cq.cc Revert "Revert "Start supporting a callback-based RPC under lock"" 2019-05-29 13:15:47 -07:00
bm_cq_multiple_threads.cc s/atleast/at\ least 2019-04-25 17:15:30 -07:00
bm_error.cc Made gRPC inialized after entering main function in microbenchmarks. 2019-05-02 16:58:37 -07:00
bm_fullstack_streaming_ping_pong.cc Made gRPC inialized after entering main function in microbenchmarks. 2019-05-02 16:58:37 -07:00
bm_fullstack_streaming_pump.cc Made gRPC inialized after entering main function in microbenchmarks. 2019-05-02 16:58:37 -07:00
bm_fullstack_trickle.cc Made gRPC inialized after entering main function in microbenchmarks. 2019-05-02 16:58:37 -07:00
bm_fullstack_unary_ping_pong.cc Made gRPC inialized after entering main function in microbenchmarks. 2019-05-02 16:58:37 -07:00
bm_metadata.cc Added specializations for grpc_mdelem_create. 2019-07-30 17:07:44 -07:00
bm_opencensus_plugin.cc Fix errors from clang_format_code.sh 2019-03-25 15:49:22 -07:00
bm_pollset.cc Made gRPC inialized after entering main function in microbenchmarks. 2019-05-02 16:58:37 -07:00
bm_threadpool.cc SpikyLoad: construct outside 2019-07-29 10:52:32 -07:00
bm_timer.cc Made gRPC inialized after entering main function in microbenchmarks. 2019-05-02 16:58:37 -07:00
callback_streaming_ping_pong.h Revert "Revert "Start supporting a callback-based RPC under lock"" 2019-05-29 13:15:47 -07:00
callback_test_service.cc Cancel predefine number of streaming 2019-05-13 13:29:06 -07:00
callback_test_service.h Cancel predefine number of streaming 2019-05-13 13:29:06 -07:00
callback_unary_ping_pong.h Add assertion 2019-05-09 12:22:55 -07:00
fullstack_context_mutators.h Change grpc++ references in names to grpcpp 2018-03-08 22:04:59 -08:00
fullstack_fixtures.h Move Channel to grpc_impl 2019-05-17 09:12:33 -07:00
fullstack_streaming_ping_pong.h Autofix c casts to c++ casts 2018-02-09 09:16:55 -08:00
fullstack_streaming_pump.h Autofix c casts to c++ casts 2018-02-09 09:16:55 -08:00
fullstack_unary_ping_pong.h Desneak client unary call, avoid Hyrum's Law (used for 1-thread simplicity) 2018-03-20 08:46:28 -07:00
helpers.cc Made gRPC inialized after entering main function in microbenchmarks. 2019-05-02 16:58:37 -07:00
helpers.h Made gRPC inialized after entering main function in microbenchmarks. 2019-05-02 16:58:37 -07:00
noop-benchmark.cc auto-fix most of licenses 2017-06-08 11:22:41 +02:00
representative_server_initial_metadata.headers HPACK parsing benchmarks 2017-02-23 08:48:34 -08:00
representative_server_trailing_metadata.headers HPACK parsing benchmarks 2017-02-23 08:48:34 -08:00