grpc/include/grpcpp/impl/codegen
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
..
security Move headers from grpc++ to grpcpp 2018-02-15 14:49:34 -08:00
async_generic_service.h Support callback-based generic service 2019-03-04 13:13:12 -08:00
async_stream.h Change types to use C++ types rather than core types 2018-10-16 14:10:48 -07:00
async_unary_call.h Address reviewer comments. 2018-10-31 01:02:07 -07:00
byte_buffer.h Avoid build errors 2019-02-26 03:08:06 -08:00
call.h Rename call.h to call_op_set.h and call_wrapper.h to call.h 2018-10-26 15:15:48 -07:00
call_hook.h Move headers from grpc++ to grpcpp 2018-02-15 14:49:34 -08:00
call_op_set.h Rever copyright changes 2019-01-28 16:18:49 -08:00
call_op_set_interface.h Address reviewer comments. 2018-10-31 01:02:07 -07:00
callback_common.h Streaming API for callback servers 2018-11-30 16:14:21 -08:00
channel_interface.h Allow the interceptor to know the method type 2018-12-06 15:51:31 -08:00
client_callback.h Add support for extra-reaction operations via Holds 2019-03-15 16:17:01 -07:00
client_context.h Revert "Folding the Channel class into the grpc_impl namespace." 2019-02-15 09:52:15 -08:00
client_interceptor.h Merge pull request #17978 from yashykt/interceptorcleanup1 2019-03-20 19:13:55 -07:00
client_unary_call.h Rename new SendMessage types to SendMessagePtr 2019-01-02 14:46:52 -08:00
completion_queue.h Revert "Folding the Channel class into the grpc_impl namespace." 2019-02-15 09:52:15 -08:00
completion_queue_tag.h Address reviewer comments 2018-09-11 09:14:57 -07:00
config.h Move headers from grpc++ to grpcpp 2018-02-15 14:49:34 -08:00
config_protobuf.h Unifying grpc build hacks 2018-10-24 17:25:51 -07:00
core_codegen.h Introduce grpc_byte_buffer_reader_peek and use it for Protobuf parsing. 2019-03-21 06:03:45 -04:00
core_codegen_interface.h Introduce grpc_byte_buffer_reader_peek and use it for Protobuf parsing. 2019-03-21 06:03:45 -04:00
create_auth_context.h Move headers from grpc++ to grpcpp 2018-02-15 14:49:34 -08:00
grpc_library.h fix non-virtual-dtor 2018-02-16 12:42:05 +01:00
intercepted_channel.h Register global interceptors functionality 2018-10-30 02:43:01 -07:00
interceptor.h Remove extra semicolons after function definitions 2019-02-20 17:58:30 -08:00
interceptor_common.h Fixing memory leak in interceptor by removing unsued send_status_ 2019-03-13 21:42:02 +01:00
metadata_map.h Properly clear metadata and other structs when reusing ServerContext 2018-11-13 12:44:56 -08:00
method_handler_impl.h Rename new SendMessage types to SendMessagePtr 2019-01-02 14:46:52 -08:00
proto_buffer_reader.h Introduce grpc_byte_buffer_reader_peek and use it for Protobuf parsing. 2019-03-21 06:03:45 -04:00
proto_buffer_writer.h Rename ProtoBuffer helpers 2018-04-12 17:19:54 -07:00
proto_utils.h Rename ProtoBuffer helpers 2018-04-12 17:19:54 -07:00
rpc_method.h Move headers from grpc++ to grpcpp 2018-02-15 14:49:34 -08:00
rpc_service_method.h Address reviewer comments. 2018-10-31 01:02:07 -07:00
serialization_traits.h Move headers from grpc++ to grpcpp 2018-02-15 14:49:34 -08:00
server_callback.h Address reviewer comments 2019-03-18 16:51:15 -07:00
server_context.h Support callback on cancellation of server-side unary RPCs 2019-03-18 12:00:57 -07:00
server_interceptor.h Remove extra semicolons after function definitions 2019-02-20 17:58:30 -08:00
server_interface.h Support callback-based generic service 2019-03-04 13:13:12 -08:00
service_type.h Experimental C++ server callback unary API 2018-10-29 13:41:25 -07:00
slice.h Make GrpcProtoBufferReaderWriter public 2018-04-06 07:05:27 -07:00
status.h Delete status_test that has no coverage; replace with static_asserts 2018-03-15 11:30:59 -07:00
status_code_enum.h Move headers from grpc++ to grpcpp 2018-02-15 14:49:34 -08:00
string_ref.h Move headers from grpc++ to grpcpp 2018-02-15 14:49:34 -08:00
stub_options.h Move headers from grpc++ to grpcpp 2018-02-15 14:49:34 -08:00
sync_stream.h Rename new SendMessage types to SendMessagePtr 2019-01-02 14:46:52 -08:00
time.h Move headers from grpc++ to grpcpp 2018-02-15 14:49:34 -08:00