grpc/include/grpcpp
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
..
ext reviewer feedback 2018-07-20 09:29:05 -07:00
generic Stop exposing streaming object class 2018-11-30 04:13:40 -08:00
impl Introduce grpc_byte_buffer_reader_peek and use it for Protobuf parsing. 2019-03-21 06:03:45 -04:00
security Remove extra semicolons after function definitions 2019-02-20 17:58:30 -08:00
support Revert "Moving ::grpc::ResourceQuota to ::grpc_impl::ResouceQuota" 2019-03-12 12:25:38 -07:00
test Move headers from grpc++ to grpcpp 2018-02-15 14:49:34 -08:00
alarm.h Moving ::grpc::Alarm to ::grpc_impl::Alarm. 2018-12-12 16:48:32 +01:00
alarm_impl.h Allow an alarm to be set again after firing 2019-02-05 14:07:40 -08:00
channel.h Revert "Folding the Channel class into the grpc_impl namespace." 2019-02-15 09:52:15 -08:00
client_context.h Fix typos 2018-04-04 10:26:57 -07:00
completion_queue.h Move headers from grpc++ to grpcpp 2018-02-15 14:49:34 -08:00
create_channel.h Remove the std::unique_ptr, instead use move semantics everywhere 2018-11-15 16:49:43 -08:00
create_channel_posix.h Add experimental versions with interceptors for create channel from fd and inproc channel 2018-09-30 22:13:44 -07:00
grpcpp.h Move headers from grpc++ to grpcpp 2018-02-15 14:49:34 -08:00
health_check_service_interface.h Add a Shutdown call to HealthCheckServiceInterface 2018-12-06 16:16:58 -08:00
opencensus.h Revert "Fold opencensus into grpc_impl namespace" 2019-03-15 10:20:06 -07:00
resource_quota.h Revert "Moving ::grpc::ResourceQuota to ::grpc_impl::ResouceQuota" 2019-03-12 12:25:38 -07:00
server.h Properly implement unimplemented RPCs at callback-only server 2019-03-06 23:43:34 -08:00
server_builder.h Revert "Moving ::grpc::ResourceQuota to ::grpc_impl::ResouceQuota" 2019-03-12 12:25:38 -07:00
server_context.h Move headers from grpc++ to grpcpp 2018-02-15 14:49:34 -08:00
server_posix.h Move headers from grpc++ to grpcpp 2018-02-15 14:49:34 -08:00