Commit Graph

704 Commits

Author SHA1 Message Date
Vijay Pai 0c0f3f0556 Declare microbenchmarks as tests rather than binaries, fix issues 2020-02-13 09:34:15 -08:00
Vijay Pai 2678afe310 Stop using core server shutdown in microbenchmarks 2020-01-21 14:24:42 -08:00
Lidi Zheng d5d6914751 Make buildifier sanity test fail-able 2019-12-18 16:16:49 -08:00
Jan Tattermusch 5d352ded8b disable a few macos bazel tests 2019-11-25 13:35:26 +01:00
Vijay Pai be6979202b Revamp server-side C++ callback API, message allocator, and mocking 2019-11-20 16:56:18 -08:00
Yash Tibrewal 79aa21fa71 Reviewer comments 2019-11-13 14:14:02 -08:00
Yash Tibrewal 61020b55f9 Remove GRPC_CLOSURE_LIST_SCHED and remove scheduler field from grpc_closure 2019-11-12 18:23:29 -08:00
Yash Tibrewal d60b60a837 Reviewer comments 2019-11-08 10:45:50 -08:00
Yash Tibrewal fe88f14410 Merge branch 'master' into removrun 2019-11-07 15:13:03 -08:00
Esun Kim 3a519a0b64 Replaced grpc_core New & Delete with C++ new & delete 2019-11-06 17:52:26 -08:00
Lidi Zheng c34bef4ca4 Format all Bazel files with buildifier 2019-11-05 14:03:52 -08:00
Yash Tibrewal 08ba7246c0 Remove GRPC_CLOSURE_RUN and replace with grpc_core::Closure::Run 2019-11-01 16:21:16 -07:00
Yash Tibrewal 3a189d7e08 test changes 2019-10-31 17:09:38 -07:00
Vijay Pai e35c869aaf Remove unused-parameter warnings, round 2 (19 of 19) 2019-10-21 09:16:35 -07:00
Yash Tibrewal 780d41224c Squashed commit of the following:
commit 1547cb209a
Author: Yash Tibrewal <yashkt@google.com>
Date:   Fri Oct 18 13:12:55 2019 -0700

    Revert some other GRPC_CLOSURE_RUN till other issues are fixed

commit 3edeee7ce9
Merge: 22b343e4fb e8f78e7a5d
Author: Yash Tibrewal <yashkt@google.com>
Date:   Fri Oct 18 12:26:26 2019 -0700

    Merge branch 'master' into combinernew

commit 22b343e4fb
Author: Yash Tibrewal <yashkt@google.com>
Date:   Fri Oct 18 12:22:34 2019 -0700

    Change some TCP posix closures to GRPC_CLOSURE_RUN

commit 19e60dfe8f
Merge: 153bdcbc97 feae38d3ab
Author: Yash Tibrewal <yashkt@google.com>
Date:   Thu Oct 17 11:56:46 2019 -0700

    Merge branch 'master' into combinernew

commit 153bdcbc97
Author: Yash Tibrewal <yashkt@google.com>
Date:   Thu Oct 17 11:41:14 2019 -0700

    Proxy fixture fix

commit c6da80bcce
Merge: 6a32264cdf 98abc22f4c
Author: Yash Tibrewal <yashkt@google.com>
Date:   Fri Oct 11 17:05:18 2019 -0700

    Merge branch 'master' into combinernew

commit 6a32264cdf
Author: Yash Tibrewal <yashkt@google.com>
Date:   Fri Oct 11 17:01:55 2019 -0700

    Reviewer comments

commit 6bbd3a1c3c
Author: Yash Tibrewal <yashkt@google.com>
Date:   Thu Oct 10 11:55:43 2019 -0700

    Fallback cleanup

commit aaa04526a2
Author: Yash Tibrewal <yashkt@google.com>
Date:   Thu Oct 10 11:24:18 2019 -0700

    Clean up

commit 4266be13d5
Author: Yash Tibrewal <yashkt@google.com>
Date:   Thu Oct 10 11:20:05 2019 -0700

    Make sure start_ping is called before finish_ping for bdp and keepalive

commit 14107957aa
Author: Yash Tibrewal <yashkt@google.com>
Date:   Wed Oct 9 18:56:07 2019 -0700

    chttp2 fixes

commit 5643aa6cb3
Author: Yash Tibrewal <yashkt@google.com>
Date:   Wed Oct 9 18:25:19 2019 -0700

    Remove closure list scheduling from combiners

commit c596449430
Author: Yash Tibrewal <yashkt@google.com>
Date:   Wed Oct 9 17:35:54 2019 -0700

    ares windows fix

commit 9f933903b9
Author: Yash Tibrewal <yashkt@google.com>
Date:   Wed Oct 9 17:23:11 2019 -0700

    More fixes

commit 3c3a7d0e9b
Author: Yash Tibrewal <yashkt@google.com>
Date:   Wed Oct 9 16:08:07 2019 -0700

    Fix errors

commit 56539cc448
Author: Yash Tibrewal <yashkt@google.com>
Date:   Wed Oct 9 15:22:28 2019 -0700

    Everything compiles

commit 714ec01e4b
Author: Yash Tibrewal <yashkt@google.com>
Date:   Wed Oct 9 13:44:18 2019 -0700

    src compiles

commit 54dcbd170d
Author: Yash Tibrewal <yashkt@google.com>
Date:   Wed Oct 9 13:16:08 2019 -0700

    chttp2_transport changes

commit 7a3388b077
Author: Yash Tibrewal <yashkt@google.com>
Date:   Tue Oct 8 18:33:55 2019 -0700

    resource quota and lb policy

commit 714e4c849f
Author: Yash Tibrewal <yashkt@google.com>
Date:   Tue Oct 8 17:23:04 2019 -0700

    Further

commit 1d17ad7d44
Author: Yash Tibrewal <yashkt@google.com>
Date:   Tue Oct 8 13:34:52 2019 -0700

    ares ev driver windows changes

commit 3110c062c5
Author: Yash Tibrewal <yashkt@google.com>
Date:   Tue Oct 8 12:47:37 2019 -0700

    ares dns changes

commit 0e10bc17ea
Author: Yash Tibrewal <yashkt@google.com>
Date:   Tue Oct 8 12:24:45 2019 -0700

    Add dns_resolver changes

commit 4a71a911e8
Author: Yash Tibrewal <yashkt@google.com>
Date:   Tue Oct 8 12:08:10 2019 -0700

    Add fake_resolver changes

commit 8610a64ec9
Author: Yash Tibrewal <yashkt@google.com>
Date:   Mon Oct 7 19:31:13 2019 -0700

    Remaning one from xds_client

commit 5f22055d0d
Author: Yash Tibrewal <yashkt@google.com>
Date:   Mon Oct 7 18:47:28 2019 -0700

    One left from xds_client.cc

commit 4b1223f875
Author: Yash Tibrewal <yashkt@google.com>
Date:   Mon Oct 7 17:17:12 2019 -0700

    modifications for xds.cc

commit a17bbbd840
Author: Yash Tibrewal <yashkt@google.com>
Date:   Mon Oct 7 13:06:25 2019 -0700

    grpclb.cc changes

commit 3a33ed4762
Merge: 11058748fd 3d363368ca
Author: Yash Tibrewal <yashkt@google.com>
Date:   Mon Oct 7 11:24:11 2019 -0700

    Merge branch 'combinernew' of github.com:yashykt/grpc into combinernew

commit 3d363368ca
Author: Yash Tibrewal <yashkt@google.com>
Date:   Mon Oct 7 11:18:00 2019 -0700

    New combiner
2019-10-18 15:07:54 -07:00
Vijay Pai e8f78e7a5d
Merge pull request #20644 from vjpai/remove_warn_17
Remove unused parameter warnings (17 of 20)
2019-10-18 10:32:48 -07:00
Vijay Pai 82e185399d clang-format 2019-10-17 09:08:21 -07:00
Vijay Pai 0cab2084e6 clang-format 2019-10-17 09:08:04 -07:00
Vijay Pai 6ca827a008 Remove unused parameter warning (18 of 20) 2019-10-17 08:52:05 -07:00
Vijay Pai 406b70629a Remove unused parameter warning (17 of 20) 2019-10-17 08:52:00 -07:00
Yash Tibrewal 0a57e9cc69 Fix bm chttp2 transport 2019-10-02 16:14:43 -07:00
Soheil Hassas Yeganeh c9376b4e0b Use cycle clock instead of clock monotonic to measure call latency.
This removes two more getttime syscalls from the hot path, when cycle
clock is enabled.
2019-09-09 10:37:48 -04:00
Arjun Roy 0b06676c9e hpack encoder optimizations.
Removed some cycles and branches from hpack_enc for CH2.
Specifically:
1. Pushed certain metadata key/value length checks to
prepare_application_metadata() in src/core/lib/surface/call.cc.
This means that rather than check all key/val lengths for all metadata, we only
do so for custom added user metadata. Inside CH2, we change the length checks to
debug checks so we can catch if core/filter metadata fails to pass the check.

2. Changed various asserts to debug asserts when able.

3. Refactored some of the header emission code to remove duplicated code.

4. Un-inlined some logging methods.

This results in somewhat faster hpack_encoder performance:

BM_HpackEncoderInitDestroy
222ns ± 0%              221ns ± 0%   -0.29%        (p=0.000 n=34+34)
BM_HpackEncoderEncodeDeadline
[framing_bytes/iter:9 header_bytes/iter:6       ]               135ns ± 1%
124ns ± 0%   -8.05%        (p=0.000 n=39+38)
BM_HpackEncoderEncodeHeader<EmptyBatch>/0/16384
[framing_bytes/iter:9 header_bytes/iter:0       ]              34.2ns ± 0%
34.2ns ± 0%   -0.01%        (p=0.014 n=34+38)
BM_HpackEncoderEncodeHeader<EmptyBatch>/1/16384
[framing_bytes/iter:9 header_bytes/iter:0       ]              34.2ns ± 0%
34.2ns ± 0%   -0.04%        (p=0.004 n=34+37)
BM_HpackEncoderEncodeHeader<SingleStaticElem>/0/16384
[framing_bytes/iter:9 header_bytes/iter:1       ]              47.5ns ± 0%
45.9ns ± 0%   -3.28%        (p=0.000 n=28+38)
BM_HpackEncoderEncodeHeader<SingleInternedKeyElem>/0/16384
[framing_bytes/iter:9 header_bytes/iter:6       ]              77.0ns ± 1%
68.3ns ± 1%  -11.33%        (p=0.000 n=39+40)
BM_HpackEncoderEncodeHeader<SingleInternedElem>/0/16384
[framing_bytes/iter:9 header_bytes/iter:1       ]              47.7ns ± 1%
45.5ns ± 0%   -4.63%        (p=0.000 n=39+33)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<1, false>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:1       ]              47.2ns ± 0%
45.3ns ± 0%   -3.96%        (p=0.000 n=33+34)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<3, false>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:1       ]              47.7ns ± 0%
45.6ns ± 0%   -4.54%        (p=0.000 n=38+40)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<10, false>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:1       ]              47.7ns ± 0%
45.5ns ± 0%   -4.63%        (p=0.000 n=39+32)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<31, false>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:1       ]              47.8ns ± 0%
45.6ns ± 1%   -4.59%        (p=0.000 n=38+39)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<100, false>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:1       ]              47.8ns ± 0%
45.5ns ± 0%   -4.64%        (p=0.000 n=39+36)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<1, true>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:1       ]              47.3ns ± 0%
45.3ns ± 0%   -4.09%        (p=0.000 n=38+36)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<3, true>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:1       ]              47.8ns ± 1%
45.6ns ± 0%   -4.71%        (p=0.000 n=37+40)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<10, true>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:1       ]              47.7ns ± 0%
45.5ns ± 0%   -4.66%        (p=0.000 n=39+32)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<31, true>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:1       ]              47.8ns ± 1%
45.6ns ± 1%   -4.62%        (p=0.000 n=37+39)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<100, true>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:1       ]              47.7ns ± 0%
45.5ns ± 0%   -4.67%        (p=0.000 n=38+32)
BM_HpackEncoderEncodeHeader<SingleNonInternedElem>/0/16384
[framing_bytes/iter:9 header_bytes/iter:9       ]              80.5ns ± 1%
74.7ns ± 0%   -7.16%        (p=0.000 n=38+35)
BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<1, false>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:12      ]               105ns ± 1%
99ns ± 0%   -5.91%        (p=0.000 n=38+34)
BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<3, false>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:14      ]               111ns ± 1%
106ns ± 1%   -4.86%         (p=0.020 n=39+2)
BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<10, false>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:23      ]               135ns ± 0%
130ns ± 0%   -3.45%         (p=0.020 n=35+2)
BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<31, false>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:46      ]               225ns ± 1%
223ns ± 0%   -0.91%         (p=0.003 n=37+2)
BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<100, false>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:120     ]               467ns ± 0%
472ns ± 0%   +1.09%         (p=0.003 n=38+2)
BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<1, true>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:12      ]              81.6ns ± 1%
74.8ns ± 0%   -8.40%        (p=0.000 n=37+33)
BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<3, true>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:14      ]              82.0ns ± 1%
74.8ns ± 0%   -8.80%        (p=0.000 n=37+32)
BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<10, true>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:21      ]              82.1ns ± 1%
74.9ns ± 0%   -8.86%        (p=0.000 n=35+34)
BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<31, true>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:42      ]              97.6ns ± 2%
91.8ns ± 0%   -5.95%        (p=0.000 n=35+27)
BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<100, true>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:111     ]              97.2ns ± 1%
91.2ns ± 2%   -6.19%        (p=0.000 n=37+38)
BM_HpackEncoderEncodeHeader<SingleNonInternedElem>/0/1
[framing_bytes/iter:54 header_bytes/iter:9      ]               230ns ± 0%
221ns ± 0%   -3.91%        (p=0.000 n=38+37)
BM_HpackEncoderEncodeHeader<MoreRepresentativeClientInitialMetadata>/0/16384
[framing_bytes/iter:9 header_bytes/iter:16      ]               206ns ± 2%
170ns ± 1%  -17.51%        (p=0.000 n=39+39)
BM_HpackEncoderEncodeHeader<RepresentativeServerInitialMetadata>/0/16384
[framing_bytes/iter:9 header_bytes/iter:3       ]              66.4ns ± 2%
62.5ns ± 1%   -5.85%        (p=0.000 n=34+39)
BM_HpackEncoderEncodeHeader<RepresentativeServerTrailingMetadata>/1/16384
[framing_bytes/iter:9 header_bytes/iter:1       ]              47.5ns ± 0%
45.9ns ± 1%   -3.29%        (p=0.000 n=26+38)
2019-09-06 13:43:29 -07:00
Vijay Pai 9bb1247bdb
Merge pull request #16327 from vjpai/keep_running
C++ microbenchmarks: update from KeepRunning to range-based for
2019-09-05 11:07:53 -07:00
Arjun Roy 6175294416
Merge pull request #20014 from arjunroy/on_hdr_nobranch
s/branch/tail_call/ for CH2 on_hdr().
2019-09-03 12:44:56 -07:00
Hope Casey-Allen 32801fb5eb Remove build target for microbenchmark 2019-08-29 14:11:05 -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 b46e3668d3 s/branch/tail_call/ for CH2 on_hdr().
on_hdr() checks if a void-return function pointer is null before jumping to it.
If it is null, it returns an error; else it executes that function and returns
success.

This change converts the void-returning function to one that returns a
grpc_error* and thus saves a branch in on_hdr() (since we're branching once by
following the function pointer anyways, we're effectively coalescing these two
branches).
2019-08-28 13:06:11 -07:00
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