Arjun Roy
d527c1fbda
Pre-compute static metadata index for hpack_encoder.
...
Originally, hpack_encoder would check if a metadata was static or not by
comparing its pointer to the known static metadata global table and checking if
it was within bounds. This check was performed regardless of if the metadata was
static or not, and is somewhat costly.
Instead, we now pre-compute the static metadata index during code generation
time, and store it with static metadata objects. We read that value only if we
are dealing with a static metadata flag (which we know from the storage type of
the grpc_mdelem).
This yields slightly faster metadata encoding:
BM_HpackEncoderEncodeHeader<EmptyBatch>/0/16384
[framing_bytes/iter:9 header_bytes/iter:0 ] 34.9ns ± 2%
34.2ns ± 1% -2.04% (p=0.000 n=20+20)
BM_HpackEncoderEncodeHeader<EmptyBatch>/1/16384
[framing_bytes/iter:9 header_bytes/iter:0 ] 34.9ns ± 2%
34.2ns ± 1% -2.01% (p=0.000 n=20+19)
BM_HpackEncoderEncodeHeader<SingleStaticElem>/0/16384
[framing_bytes/iter:9 header_bytes/iter:1 ] 50.6ns ± 0%
49.2ns ± 2% -2.74% (p=0.000 n=18+20)
BM_HpackEncoderEncodeHeader<SingleInternedKeyElem>/0/16384
[framing_bytes/iter:9 header_bytes/iter:6 ] 84.7ns ± 1%
83.5ns ± 1% -1.43% (p=0.000 n=20+20)
BM_HpackEncoderEncodeHeader<SingleInternedElem>/0/16384
[framing_bytes/iter:9 header_bytes/iter:1 ] 50.4ns ± 0%
47.9ns ± 0% -4.83% (p=0.000 n=18+17)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<1, false>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:1 ] 51.1ns ± 2%
48.9ns ± 1% -4.32% (p=0.000 n=20+20)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<3, false>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:1 ] 50.8ns ± 2%
48.8ns ± 2% -3.88% (p=0.000 n=19+20)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<10, false>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:1 ] 50.2ns ± 1%
47.9ns ± 0% -4.47% (p=0.000 n=19+16)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<31, false>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:1 ] 50.2ns ± 0%
47.9ns ± 0% -4.46% (p=0.000 n=18+16)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<100, false>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:1 ] 50.2ns ± 0%
47.9ns ± 0% -4.40% (p=0.000 n=19+17)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<1, true>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:1 ] 50.7ns ± 2%
48.8ns ± 2% -3.81% (p=0.000 n=20+20)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<3, true>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:1 ] 50.9ns ± 2%
48.8ns ± 2% -4.05% (p=0.000 n=20+20)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<10, true>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:1 ] 50.1ns ± 0%
48.0ns ± 1% -4.27% (p=0.000 n=17+17)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<31, true>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:1 ] 50.1ns ± 0%
48.0ns ± 1% -4.28% (p=0.000 n=18+17)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<100, true>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:1 ] 50.1ns ± 0%
48.0ns ± 0% -4.33% (p=0.000 n=18+17)
BM_HpackEncoderEncodeHeader<SingleNonInternedElem>/0/16384
[framing_bytes/iter:9 header_bytes/iter:9 ] 91.4ns ± 1%
90.7ns ± 1% -0.79% (p=0.000 n=18+20)
BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<1, false>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:12 ] 116ns ± 1%
116ns ± 1% -0.46% (p=0.002 n=20+20)
BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<3, false>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:14 ] 122ns ± 0%
121ns ± 0% -0.69% (p=0.000 n=20+20)
BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<10, false>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:23 ] 144ns ± 1%
144ns ± 0% -0.23% (p=0.009 n=20+20)
BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<31, false>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:46 ] 232ns ± 0%
232ns ± 1% -0.26% (p=0.021 n=18+19)
BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<1, true>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:12 ] 92.9ns ± 1%
92.0ns ± 1% -0.97% (p=0.000 n=19+19)
BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<3, true>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:14 ] 94.0ns ± 1%
92.6ns ± 1% -1.45% (p=0.000 n=20+19)
BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<10, true>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:21 ] 93.9ns ± 2%
92.8ns ± 1% -1.17% (p=0.001 n=20+19)
BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<100, true>>/0/16384
[framing_bytes/iter:9 header_bytes/iter:111 ] 106ns ± 0%
105ns ± 3% -1.15% (p=0.000 n=18+20)
BM_HpackEncoderEncodeHeader<SingleNonInternedElem>/0/1
[framing_bytes/iter:81 header_bytes/iter:9 ] 355ns ± 1%
354ns ± 0% -0.35% (p=0.015 n=19+20)
BM_HpackEncoderEncodeHeader<RepresentativeClientInitialMetadata>/0/16384
[framing_bytes/iter:9 header_bytes/iter:8.00002 ] 139ns ± 1%
133ns ± 1% -4.46% (p=0.000 n=19+20)
BM_HpackEncoderEncodeHeader<MoreRepresentativeClientInitialMetadata>/0/16384
[framing_bytes/iter:9 header_bytes/iter:16 ] 236ns ± 1%
231ns ± 1% -2.24% (p=0.000 n=20+20)
BM_HpackEncoderEncodeHeader<RepresentativeServerInitialMetadata>/0/16384
[framing_bytes/iter:9 header_bytes/iter:3 ] 73.6ns ± 1%
70.5ns ± 1% -4.14% (p=0.000 n=20+20)
BM_HpackEncoderEncodeHeader<RepresentativeServerTrailingMetadata>/1/16384
[framing_bytes/iter:9 header_bytes/iter:1 ] 50.5ns ± 0%
49.2ns ± 2% -2.60% (p=0.000 n=16+20)
6 years ago
Soheil Hassas Yeganeh
fedf7e373e
Fix a backward compatibility bug.
...
To remain backward compatible, we only set port if it's a non-emptry
string. But, we always store host.
6 years ago
Soheil Hassas Yeganeh
c9ec1a64ed
Fix SplitHostPort for empty strings.
...
Add unittests to catch such errors in the future.
6 years ago
Soheil Hassas Yeganeh
dbf88dd66f
Revert "Revert "Introduce string_view and use it for gpr_split_host_port.""
...
This reverts commit 80c177d4c4
.
6 years ago
Arjun Roy
80d1aec021
Codegen optimizations for hpack_parser on_hdr.
...
Currently, the log statements for on_hdr clobber some registers even if it is
disabled by default. Additionally, the no-error path is doing some unnecessary
jumps. This PR separates out and un-inlines the logging code, and marks the
no-error case as likely to occur.
This results in slightly faster hpack_parsing, e.g.:
BM_HpackParserParseHeader<IndexedSingleStaticElem, UnrefHeader>
23.8ns ± 0% 19.8ns ± 0% -16.81% (p=0.000 n=17+17)
BM_HpackParserParseHeader<AddIndexedSingleStaticElem, UnrefHeader>
160ns ± 0% 154ns ± 0% -3.18% (p=0.000 n=19+20)
BM_HpackParserParseHeader<KeyIndexedSingleStaticElem, UnrefHeader>
216ns ± 1% 214ns ± 2% -0.70% (p=0.004 n=18+18)
BM_HpackParserParseHeader<IndexedSingleInternedElem, UnrefHeader>
35.4ns ± 0% 34.4ns ± 0% -2.93% (p=0.000 n=16+16)
BM_HpackParserParseHeader<RepresentativeClientInitialMetadata, UnrefHeader>
140ns ± 0% 130ns ± 0% -7.06% (p=0.000 n=17+18)
BM_HpackParserParseHeader<MoreRepresentativeClientInitialMetadata, UnrefHeader>
644ns ± 1% 636ns ± 2% -1.29% (p=0.003 n=17+20)
BM_HpackParserParseHeader<RepresentativeServerInitialMetadata, UnrefHeader>
49.1ns ± 0% 38.7ns ± 0% -21.13% (p=0.000 n=19+18)
BM_HpackParserParseHeader<RepresentativeServerTrailingMetadata, UnrefHeader>
47.1ns ± 0% 43.2ns ± 0% -8.17% (p=0.000 n=20+19)
BM_HpackParserParseHeader<RepresentativeClientInitialMetadata, OnInitialHeader>
452ns ± 1% 417ns ± 1% -7.86% (p=0.000 n=20+20)
BM_HpackParserParseHeader<MoreRepresentativeClientInitialMetadata,
OnInitialHeader>
1.06µs ± 1% 1.02µs ± 2% -3.42% (p=0.000 n=19+20)
BM_HpackParserParseHeader<RepresentativeServerInitialMetadata, OnInitialHeader>
156ns ± 0% 142ns ± 1% -9.08% (p=0.000 n=17+19)
BM_HpackParserParseHeader<SameDeadline, OnHeaderTimeout>
117ns ± 0% 113ns ± 1% -3.98% (p=0.000 n=20+20)
6 years ago
nanahpang
36339f4032
fix typo "transfered" to "transferred"
...
find the typo during import and create this pr to sync up
6 years ago
Alexander Polcyn
0d2c622f9e
Fix DNS resolver cooldown
6 years ago
Muxi Yan
424328b8e7
Resolve uninitialized warning
6 years ago
Yunjia Wang
b95bb89d13
Add TODO comment
6 years ago
Arjun Roy
0fc57d0414
Slightly better codegen for hpack_encoder.
...
hpack_encoder::ensure_space checks to see if we need to allocate to start a
frame or not. The common case is that we don't need to, so we mark that code
branch as the more likely one to occur. This causes the common case to jump
around less.
BM_HpackEncoderEncodeDeadline
152ns ± 0% 149ns ± 0% -1.99% (p=0.000 n=19+17)
BM_HpackEncoderEncodeHeader<EmptyBatch>/0/16384
35.0ns ± 2% 34.6ns ± 0% -1.10% (p=0.000 n=20+17)
BM_HpackEncoderEncodeHeader<EmptyBatch>/1/16384
34.9ns ± 1% 34.7ns ± 1% -0.81% (p=0.007 n=20+19)
BM_HpackEncoderEncodeHeader<SingleStaticElem>/0/16384
50.6ns ± 0% 49.1ns ± 1% -3.06% (p=0.000 n=17+19)
BM_HpackEncoderEncodeHeader<SingleInternedKeyElem>/0/16384
84.9ns ± 1% 82.4ns ± 1% -2.90% (p=0.000 n=20+19)
BM_HpackEncoderEncodeHeader<SingleInternedElem>/0/16384
50.5ns ± 0% 49.2ns ± 1% -2.54% (p=0.000 n=15+19)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<1, false>>/0/16384
50.8ns ± 2% 49.6ns ± 1% -2.46% (p=0.000 n=17+19)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<3, false>>/0/16384
50.9ns ± 2% 49.5ns ± 1% -2.78% (p=0.000 n=20+19)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<10, false>>/0/16384
50.4ns ± 1% 49.2ns ± 1% -2.32% (p=0.000 n=18+19)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<31, false>>/0/16384
50.3ns ± 0% 49.2ns ± 1% -2.16% (p=0.000 n=18+19)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<100, false>>/0/16384
50.4ns ± 1% 49.2ns ± 1% -2.35% (p=0.000 n=19+19)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<1, true>>/0/16384
50.9ns ± 2% 49.4ns ± 1% -2.81% (p=0.000 n=20+19)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<3, true>>/0/16384
50.9ns ± 2% 49.4ns ± 1% -2.91% (p=0.000 n=20+19)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<10, true>>/0/16384
50.2ns ± 0% 49.2ns ± 0% -2.04% (p=0.000 n=17+19)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<31, true>>/0/16384
50.4ns ± 1% 49.2ns ± 1% -2.38% (p=0.000 n=19+19)
BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<100, true>>/0/16384
50.3ns ± 0% 49.2ns ± 0% -2.06% (p=0.000 n=19+19)
BM_HpackEncoderEncodeHeader<SingleNonInternedElem>/0/16384
91.7ns ± 1% 85.6ns ± 1% -6.64% (p=0.000 n=19+19)
BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<1, false>>/0/16384
116ns ± 1% 112ns ± 1% -3.95% (p=0.000 n=19+18)
BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<3, false>>/0/16384
122ns ± 0% 117ns ± 1% -3.63% (p=0.000 n=18+17)
BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<10, false>>/0/16384
145ns ± 1% 140ns ± 0% -2.89% (p=0.000 n=18+18)
BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<31, false>>/0/16384
233ns ± 1% 231ns ± 1% -1.14% (p=0.000 n=20+19)
BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<100, false>>/0/16384
472ns ± 1% 469ns ± 1% -0.64% (p=0.000 n=20+19)
BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<1, true>>/0/16384
93.2ns ± 1% 87.3ns ± 1% -6.41% (p=0.000 n=20+17)
BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<3, true>>/0/16384
94.2ns ± 1% 88.0ns ± 1% -6.59% (p=0.000 n=20+17)
BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<10, true>>/0/16384
94.1ns ± 2% 87.5ns ± 1% -6.98% (p=0.000 n=20+17)
BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<31, true>>/0/16384
107ns ± 2% 102ns ± 4% -4.30% (p=0.000 n=19+19)
BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<100, true>>/0/16384
106ns ± 1% 100ns ± 1% -5.64% (p=0.000 n=20+17)
BM_HpackEncoderEncodeHeader<SingleNonInternedElem>/0/1
356ns ± 1% 355ns ± 1% -0.47% (p=0.001 n=20+18)
BM_HpackEncoderEncodeHeader<RepresentativeClientInitialMetadata>/0/16384
140ns ± 1% 128ns ± 1% -7.99% (p=0.000 n=20+19)
BM_HpackEncoderEncodeHeader<MoreRepresentativeClientInitialMetadata>/0/16384
237ns ± 1% 218ns ± 1% -7.93% (p=0.000 n=19+19)
BM_HpackEncoderEncodeHeader<RepresentativeServerInitialMetadata>/0/16384
73.7ns ± 1% 69.7ns ± 1% -5.47% (p=0.000 n=20+19)
BM_HpackEncoderEncodeHeader<RepresentativeServerTrailingMetadata>/1/16384
50.7ns ± 0% 49.0ns ± 2% -3.19% (p=0.000 n=18+19)
6 years ago
yang-g
7a4b6b7e30
Update oauth2 token endpoints
6 years ago
Qixuan Li
0e85762b67
add pick_first_unary
6 years ago
Soheil Hassas Yeganeh
80c177d4c4
Revert "Introduce string_view and use it for gpr_split_host_port."
6 years ago
Julien Boeuf
189c2c8c30
Adding support for STS Token Exchange Creds in core:
...
- IETF specification is available here:
https://tools.ietf.org/html/draft-ietf-oauth-token-exchange-16
6 years ago
Prashant Jaikumar
4ad6d6d4df
Enable CFStream by default on iOS for all wrapped languages
6 years ago
Vijay Pai
ef4388b862
Explain order of callback execution in executor comments
6 years ago
Hope Casey-Allen
5a05ea0530
Format
6 years ago
Hope Casey-Allen
7f666a25ff
Remove GetC/hildSocketUuid and stop storing uuid inside ConnectedSubchannel
6 years ago
Hope Casey-Allen
03b063568d
Minor fixes
6 years ago
Jan Tattermusch
8bfb713c80
fix Grpc.Tools build
6 years ago
Jan Tattermusch
a827504ffb
get rid of workaround to build net45 targets on linux and mac
6 years ago
Alexander Polcyn
3467f2dfdc
Fix log typo
6 years ago
Hope Casey-Allen
a019017840
Address minor comments
6 years ago
Hope Casey-Allen
3c72a939fc
Remove subchannel_destroyed_
6 years ago
Hope Casey-Allen
a240860008
Minor fix
6 years ago
Hope Casey-Allen
d137ee8a85
Fix format
6 years ago
Hope Casey-Allen
b7dc509429
Minor fix
6 years ago
Hope Casey-Allen
47871c274e
Change channelz SubchannelNode to no longer take a ref to the Subchannel
6 years ago
Jan Tattermusch
1ce6d98fb4
formatting
6 years ago
Jan Tattermusch
650c0216c3
Make sure Grpc metapackage includes Grpc.Core.targets
6 years ago
Lidi Zheng
9427d1c9ce
Revert "Surface exceptions in gevent IO manager"
6 years ago
Yunjia Wang
d73abc7b56
Modify comments style
6 years ago
Arjun Roy
bff4dd1b2d
Fast-path for no-error case for grpc_error_get_status.
...
For each client side call, we execute grpc_error_get_status; in the common case
that there is no error, we save roughly 30 instructions and a call to strlen.
6 years ago
Soheil Hassas Yeganeh
889224227c
Fix a typo.
6 years ago
Moiz Haidry
63083d4472
Code cleanup
6 years ago
Guantao Liu
3ddff567b7
Fix the missing traces of metadata unref.
6 years ago
Moiz Haidry
3ce20819cf
Modify codegen to use grpc_impl namespace and other cleanups
6 years ago
Soheil Hassas Yeganeh
5435ac05ce
Fix obj-c tests.
6 years ago
Soheil Hassas Yeganeh
ef0f9bf7ec
Introduce string_view and use it for gpr_split_host_port.
6 years ago
Prashant Jaikumar
fbfb93c88f
Fix C++ tests to run on iOS
...
- Define grpc_iomgr_run_in_background in iomgr_posix_cfstream.cc
- Use *_IF_SUPPORTED() for death tests
- Move global test init, teardown to SetUpTestCase, TearDownTestCase as GTMGoogleTestRun doesn't run main()
6 years ago
Yunjia Wang
7c4c6e2e9a
Modify page_size as const var
6 years ago
Yunjia Wang
233eee421f
Modify static var to global var in file
6 years ago
Muxi Yan
72fe202369
Update Protobuf version
6 years ago
Yunjia Wang
cb8730c71d
Modify as static var
6 years ago
Muxi Yan
07728ed01c
Fix ios simulator failure
6 years ago
Muxi Yan
7eb8bac696
Resolve xcodebuild issue on Mac
6 years ago
Muxi Yan
c5c3983c97
Fix hard written port
6 years ago
Qiancheng Zhao
a75acbb6ae
Unref unselected subchannels in Pick First.
6 years ago
Yunjia Wang
1c6e8a0725
Change getpagesize for portability
6 years ago
Muxi Yan
5255b49fbc
fix run_one_test
6 years ago