grpc/test/cpp
Soheil Hassas Yeganeh ad1b3e5094 Introduce grpc_byte_buffer_reader_peek and use it for Protobuf parsing.
grpc_byte_buffer_reader_next() copies and references the slice. This
is not always necessary since the caller will not use the slice
after destroying the byte buffer.

A prominent example is the protobuf parser, which
calls grpc_byte_buffer_reader_next() and immediately unrefs the slice
after the call. This ref() and unref() calls can be very expensive
in the hot path.

This commit introduces grpc_byte_buffer_reader_peek() which
essentialy return a pointer to the slice in the buffer, i.e.,
no copies, and no refs.

QPS of 1MiB 1 Channel callback benchmark increases by 5%.
More importantly insructions per cycle is increased by 10%.

Also add tests and benchmarks for byte_buffer_reader_peek()

This commit reaplies 509e77a5a3
2019-03-21 06:03:45 -04:00
..
client Merge remote-tracking branch 'upstream/master' into gpr_test_util_to_grpc_test_util 2018-12-17 08:52:20 -08:00
cocoapods clang-format objective-c files 2018-04-11 18:10:02 -07:00
codegen Fix golden-file test 2019-02-25 23:29:02 -08:00
common Revert "Windows builds for gRPC C++ tests" 2019-03-15 17:15:20 +01:00
end2end Merge pull request #17978 from yashykt/interceptorcleanup1 2019-03-20 19:13:55 -07:00
ext/filters/census Revert "Fold opencensus into grpc_impl namespace" 2019-03-15 10:20:06 -07:00
grpclb Fix BUILD files. Manually edit bzl files 2018-12-06 14:37:52 -08:00
interop Merge pull request #18156 from mkbehr/interop-client-additional-metadata 2019-03-18 11:31:20 -07:00
microbenchmarks Introduce grpc_byte_buffer_reader_peek and use it for Protobuf parsing. 2019-03-21 06:03:45 -04:00
naming Revert "Windows builds for gRPC C++ tests" 2019-03-15 17:15:20 +01:00
performance Revert "Windows builds for gRPC C++ tests" 2019-03-15 17:15:20 +01:00
qps Revert "Windows builds for gRPC C++ tests" 2019-03-15 17:15:20 +01:00
server Revert "Windows builds for gRPC C++ tests" 2019-03-15 17:15:20 +01:00
test Fix BUILD files. Manually edit bzl files 2018-12-06 14:37:52 -08:00
thread_manager Fix BUILD files. Manually edit bzl files 2018-12-06 14:37:52 -08:00
util Merge remote-tracking branch 'upstream/master' into interop-client-additional-metadata 2019-03-06 12:40:09 -05:00