Commit Graph

27 Commits

Author SHA1 Message Date
Esun Kim 62ac3f075a Added call to grpc::testing::TestEnvironment in tests 2020-07-01 11:37:57 -07:00
Yash Tibrewal b40b162cc9 Add missing grpc_slice_unref to bm_metadata 2020-03-13 18:28:16 -07:00
Vijay Pai 1077b3435c Use range-based for on state rather than state.KeepRunning when possible 2019-08-29 11:27:00 -07:00
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
Esun Kim e18ed03c04 Made gRPC inialized after entering main function in microbenchmarks. 2019-05-02 16:58:37 -07:00
ncteisen 40ec89ff67 Support microbenchmarks internally 2018-04-25 17:41:23 -07:00
Yash Tibrewal 8cf1470a51
Revert "Revert "All instances of exec_ctx being passed around in src/core removed"" 2017-12-06 09:47:54 -08:00
Yash Tibrewal ad4d2dde00
Revert "All instances of exec_ctx being passed around in src/core removed" 2017-12-06 09:05:05 -08:00
Yash Tibrewal c354269ba7 Remove _ prefixed variable names 2017-11-29 19:07:44 -08:00
Yash Tibrewal 177039b2f8 Merge master 2017-11-16 19:31:28 -08:00
Yash Tibrewal 6c26b16fe0 Move ExecCtx to grpc_core namespace. Make exec_ctx a private static in ExecCtx and some minor changes 2017-11-14 18:11:22 -08:00
Yash Tibrewal 75122c2357 Address some PR comments 2017-11-14 01:36:28 -08:00
Craig Tiller 4ac2b8e585 Enable clang-tidy as a sanity check, fix up all known failures 2017-11-10 14:14:17 -08:00
Yash Tibrewal 3150744c71 Removing more exec_ctx instances 2017-11-09 18:27:37 -08:00
Yash Tibrewal 4e9265c828 Merge with master 2017-11-09 17:46:29 -08:00
Yash Tibrewal 39aed1ae8b Remove unnecessary extern Cs 2017-10-25 17:04:35 -07:00
Yash Tibrewal 0ee7574732 Removing instances of exec_ctx being passed around in functions in
src/core. exec_ctx is now a thread_local pointer of type ExecCtx instead of
grpc_exec_ctx which is initialized whenever ExecCtx is instantiated. ExecCtx
also keeps track of the previous exec_ctx so that nesting of exec_ctx is
allowed. This means that there is only one exec_ctx being used at any
time. Also, grpc_exec_ctx_finish is called in the destructor of the
object, and the previous exec_ctx is restored to avoid breaking current
functionality. The code still explicitly calls grpc_exec_ctx_finish
because removing all such instances causes the code to break.
2017-10-18 17:12:19 -07:00
Jan Tattermusch 7897ae9308 auto-fix most of licenses 2017-06-08 11:22:41 +02:00
Nicolas "Pixel" Noble ddab452096 Merge branch 'master' of https://github.com/grpc/grpc into cpp_bazelness 2017-03-22 18:30:44 +01:00
Craig Tiller a2d11d7bb4 Merge github.com:grpc/grpc into poll-wakeup 2017-03-10 14:14:57 -08:00
Craig Tiller af11581260 Merge github.com:grpc/grpc into cpp_bazelness 2017-03-09 15:09:34 -08:00
Craig Tiller 808d19e834 Merge pull request #9977 from ctiller/fssplit
Split bm_fullstack into pieces, reuse infrastructure across other microbenchmarks
2017-03-08 12:52:02 -08:00
Craig Tiller 1128d462c3 Pollset benchmark 2017-03-03 16:46:54 -08:00
Craig Tiller e4a2419597 Bugfixes 2017-03-03 08:53:52 -08:00
Craig Tiller 5e3215338f Move helpers to a common place, use them everywhere 2017-03-03 08:50:25 -08:00
Craig Tiller 295df6da9a Add a slice type that shares a refcount with a transport stream 2017-03-01 11:28:24 -08:00
Craig Tiller b8e2bca4eb Add a benchmark for metadata primitives 2017-02-16 16:26:51 -08:00