grpc/test/core/surface
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
..
BUILD Fix BUILD files. Manually edit bzl files 2018-12-06 14:37:52 -08:00
byte_buffer_reader_test.cc Introduce grpc_byte_buffer_reader_peek and use it for Protobuf parsing. 2019-03-21 06:03:45 -04:00
channel_create_test.cc change tests to use the new class instead of grpc_test_init 2018-11-30 08:57:38 -08:00
completion_queue_test.cc Dynamic callback requesting, graceful server shutdown, and separate ExecCtx for callbacks 2019-01-23 11:21:50 -08:00
completion_queue_threading_test.cc change tests to use the new class instead of grpc_test_init 2018-11-30 08:57:38 -08:00
concurrent_connectivity_test.cc Multiple test timeout 5x 2019-01-08 14:46:38 -08:00
init_test.cc Revert "Merge pull request #18146 from grpc/revert-17308-shutdown" 2019-02-25 10:11:06 -08:00
lame_client_test.cc change tests to use the new class instead of grpc_test_init 2018-11-30 08:57:38 -08:00
num_external_connectivity_watchers_test.cc change tests to use the new class instead of grpc_test_init 2018-11-30 08:57:38 -08:00
public_headers_must_be_c89.c Introduce grpc_byte_buffer_reader_peek and use it for Protobuf parsing. 2019-03-21 06:03:45 -04:00
secure_channel_create_test.cc Move security credentials, connectors, and auth context to C++ 2018-12-13 10:38:12 -05:00
sequential_connectivity_test.cc change tests to use the new class instead of grpc_test_init 2018-11-30 08:57:38 -08:00
server_chttp2_test.cc change tests to use the new class instead of grpc_test_init 2018-11-30 08:57:38 -08:00
server_test.cc change tests to use the new class instead of grpc_test_init 2018-11-30 08:57:38 -08:00