Commit Graph

676 Commits

Author SHA1 Message Date
Hope Casey-Allen 6dfe27ab08 Fix race in bm_chttp2_transport 2019-08-28 10:07:38 -07:00
Mark D. Roth 0bdeca47b6
Merge pull request #19038 from markdroth/lb_policy_create_channel_api_improvement
Remove CreateChannel() method from LB helper API.
2019-08-27 10:54:52 -07:00
Hope Casey-Allen 59564ebd96 Fix warnings to unblock gcc8 support 2019-08-20 16:02:53 -07:00
Mark D. Roth a23e7ab188 Merge remote-tracking branch 'upstream/master' into lb_policy_create_channel_api_improvement 2019-08-20 07:58:38 -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
yunjiaw26 f14f1dd61d
Merge pull request #19695 from yunjiaw26/bm_threadpool
Add threadpool benchmark and build files
2019-07-29 18:38:22 -07:00
Yunjia Wang 8318e578db SpikyLoad: construct outside 2019-07-29 10:52:32 -07:00
Yunjia Wang c3c24d089d Use Template 2019-07-29 10:30:09 -07:00
Yunjia Wang d87b5285ca Fix comment 2019-07-24 13:33:24 -07:00
Yunjia Wang efd6946d21 Reformat 2019-07-23 15:35:50 -07:00
Yunjia Wang 9242fe122d AddSelf more scenarios 2019-07-23 09:47:26 -07:00
Mark D. Roth 46f706c99b Revert "Merge pull request #19686 from gnossen/revert_breakage"
This reverts commit 1f2398b0d5, reversing
changes made to 99169d811c.
2019-07-23 07:50:27 -07:00
Yunjia Wang 8278d3e6a5 Resolving comments 2019-07-22 17:24:09 -07:00
Yunjia Wang 847faf407f Removes unused variable error 2019-07-19 12:10:52 -07:00
Yunjia Wang 85314b3fcc Re-format 2019-07-19 10:49:35 -07:00
Yunjia Wang c6bc2b1875 Add threadpool benchmark and build files 2019-07-19 10:23:22 -07:00
Richard Belleville 63b4f3d819 Revert "Merge pull request #19673 from markdroth/channel_grpc_init"
This reverts commit 4e21980716, reversing
changes made to 62b8a783fa.
2019-07-18 13:00:24 -07:00
Mark D. Roth 8cc5b8f680 Defer grpc shutdown until after channel destruction. 2019-07-17 16:35:14 -07:00
Arjun Roy b1d73a01f1 Removed duplicate static table from hpack table. Removed an or instruction for
every usage of static grpc metadata. Inlined hpack table lookups for static
metadata.

This leads to faster hpack parser creation:
BM_HpackParserInitDestroy 5.32µs ± 1% 0.06µs ± 1%  -98.91% (p=0.000 n=18+19)

And slightly faster parsing:
BM_HpackParserParseHeader<RepresentativeClientInitialMetadata, OnInitialHeader>
456ns ± 1%              435ns ± 1%   -4.74%        (p=0.000 n=18+19)
BM_HpackParserParseHeader<MoreRepresentativeClientInitialMetadata,
OnInitialHeader>
1.06µs ± 2%             1.04µs ± 2%   -1.82%        (p=0.000 n=19+20)

It also yields a slight (0.5 - 1.0 microsecond) reduction in CPU time for
fullstack unary pingpong:
BM_UnaryPingPong<TCP, NoOpMutator, NoOpMutator>/0/512
[polls/iter:3.0001                         ]            23.9µs ± 2%
23.0µs ± 1%  -3.63%          (p=0.002 n=6+6)
BM_UnaryPingPong<TCP, NoOpMutator, NoOpMutator>/0/32768
[polls/iter:3.00015                        ]            35.1µs ± 1%
34.2µs ± 1%  -2.57%          (p=0.036 n=5+3)
BM_UnaryPingPong<MinTCP, NoOpMutator, NoOpMutator>/8/0
[polls/iter:3.00011                        ]            21.7µs ± 3%
21.2µs ± 2%  -2.44%          (p=0.017 n=6+5)
2019-07-15 15:39:31 -07:00
Yash Tibrewal 56a0153f16 Heap allocate the stream object for other benchmark cases too 2019-06-14 14:44:49 -07:00
Yash Tibrewal cceca10a8a Fix data race, heap use-after-free issue in bm_chttp2_transport 2019-06-13 17:05:51 -07:00
Mark D. Roth 4f3a55b73d Merge remote-tracking branch 'upstream/master' into lb_policy_create_channel_api_improvement 2019-06-05 13:56:06 -07:00
Mark D. Roth 0f5834b88d Merge remote-tracking branch 'upstream/master' into lb_policy_create_channel_api_improvement 2019-05-29 15:40:24 -07:00
Karthik Ravi Shankar 196b0aa3a3
Revert "Revert "Start supporting a callback-based RPC under lock"" 2019-05-29 13:15:47 -07:00
Karthik Ravi Shankar b790c24e5c
Revert "Start supporting a callback-based RPC under lock" 2019-05-29 11:20:36 -07:00
Mark D. Roth 477ebef532 Remove CreateChannel() method from LB helper API. 2019-05-28 14:18:15 -07:00
Karthik Ravi Shankar b18faa6c95 Fix tsan error 2019-05-23 20:08:45 -07:00
Karthik Ravi Shankar d2c8eb94c9 Fix microbenchmark failures 2019-05-23 18:09:12 -07:00
Karthik Ravi Shankar 3f05ac9584 Merge branch 'master' into callback-rpc-lock 2019-05-22 17:39:08 -07:00
Karthik Ravi Shankar e1f62278e3 Fix clang error 2019-05-22 13:53:10 -07:00
Karthik Ravi Shankar 4f7f561564 Add synchronization to bm test
- since we made the callback run on another thread, add synchronization
in bm tests as well
2019-05-22 10:42:50 -07:00
Karthik Ravi Shankar 40210d3b8a Move Channel to grpc_impl 2019-05-17 09:12:33 -07:00
Karthik Ravi Shankar 772a74aced Revert changes to Channel 2019-05-15 14:24:17 -07:00
Na-Na Pang a02c76dfb9 Cancel predefine number of streaming 2019-05-13 13:29:06 -07:00
Na-Na Pang 87d75d2a88 Add explicit and fix error 2019-05-10 11:23:24 -07:00
Na-Na Pang 7a464a3bc9 Merge remote-tracking branch 'upstream/master' 2019-05-10 11:16:14 -07:00
Karthik Ravi Shankar 476f7cd81f
Merge pull request #18730 from karthikravis/grpc_namespace_channel_new
Fold Channel into grpc_impl from grpc namespace
2019-05-09 14:09:21 -07:00
Na-Na Pang a2daa4ff08 Clean format' 2019-05-09 12:29:05 -07:00
Na-Na Pang 1ea651aee3 Add assertion 2019-05-09 12:22:55 -07:00
Na-Na Pang 9b50fbcaac Solve conflict 2019-05-08 18:50:06 -07:00
Na-Na Pang 762e58b574 Change client context allocation 2019-05-08 17:34:27 -07:00
Na-Na Pang 070902b871 Merge bm_callback_cq to bm_cq 2019-05-08 15:51:58 -07:00
Na-Na Pang 3fc702510f Reuse reactor to send new RPC 2019-05-08 10:15:43 -07:00
Na-Na Pang 2d5a9750a0 Manually add echo.proto to pass Portability build test 2019-05-06 16:20:59 -07:00
Na-Na Pang 1ba5f5c701 Modify build file 2019-05-06 14:55:00 -07:00
Na-Na Pang 32e10e618a address the reference arguments 2019-05-06 10:41:37 -07:00
Na-Na Pang 714e13b426 Delete log 2019-05-06 09:25:46 -07:00
Na-Na Pang c905f76a5b Clang format 2019-05-06 09:18:29 -07:00
Na-Na Pang 4198c4fcc6 Merge remote-tracking branch 'upstream/master' 2019-05-03 10:41:12 -07:00
Na-Na Pang 2787dedd70 Modify dependency of callback_test_service 2019-05-03 10:40:49 -07:00