This reverts commit dc1089a6d1, reversing
changes made to 31843787cc.
This change also includes - Revert "Merge pull request #17932 from soheilhy/gprpp-mutex"
This reverts commit df4b6a763d, reversing
changes made to dc1089a6d1.
Introduce RAII wrappers in the grpc::internal and grpc_core
namespaces, and use them in place of std::mutex and
std::condition_variable.
Note that, since std::mutex is also used by the public
C++ headers we cannot introduce these wrappers in grpc_core.
Also, note that in grpcpp we cannot use gRPC core and vice versa.
So we had to duplicate the code, once using core_codegen_interface
and once using direct calls.
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
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()
We are planning to enable -Wextra-semi flag in our project but some
header files in gRPC have extra semicolons that violates the check and
blocks us from enabling the flag.
This change removes unnecessary semicolons in the code. Note that having
semicolon after the GRPC_ABSTRACT macro technically also violates the
check, but it's fine for us since they are not used in public headers,
and it will be confusing to have lines ending only with GRPC_ABSTRACT,
so I keep them as-is.
This should prevent warnings like the following:
=== BUILD TARGET FirebaseFirestore OF PROJECT Pods WITH CONFIGURATION Debug ===
In file included from $PROJECT_DIR/platforms/ios/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/stream.mm:17:
In file included from $PROJECT_DIR/platforms/ios/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/stream.h:27:
In file included from $PROJECT_DIR/platforms/ios/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_connection.h:28:
In file included from $PROJECT_DIR/platforms/ios/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_stream.h:35:
In file included from $PROJECT_DIR/platforms/ios/build/emulator/grpcpp.framework/Headers/generic/generic_stub.h:24:
In file included from $PROJECT_DIR/platforms/ios/build/emulator/grpcpp.framework/Headers/support/async_stream.h:22:
In file included from $PROJECT_DIR/platforms/ios/build/emulator/grpcpp.framework/Headers/impl/codegen/async_stream.h:26:
In file included from $PROJECT_DIR/platforms/ios/build/emulator/grpcpp.framework/Headers/impl/codegen/service_type.h:24:
$PROJECT_DIR/platforms/ios/build/emulator/grpcpp.framework/Headers/impl/codegen/rpc_service_method.h:49:16: warning: parameter 'rpc_requester' not found in the function declaration
[-Wdocumentation]
/// \param rpc_requester : used only by the callback API. It is a function
^~~~~~~~~~~~~
$PROJECT_DIR/platforms/ios/build/emulator/grpcpp.framework/Headers/impl/codegen/rpc_service_method.h:49:16: note: did you mean 'requester'?
/// \param rpc_requester : used only by the callback API. It is a function
^~~~~~~~~~~~~
requester
1 warning generated.