Commit Graph

226 Commits

Author SHA1 Message Date
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
Vijay Pai 50576179f8 Merge pull request #17978 from yashykt/interceptorcleanup1
Global Interceptor Registration allowed only once
2019-03-20 19:13:55 -07:00
Vijay Pai 7b3a120295 Address reviewer comments 2019-03-18 16:51:15 -07:00
Vijay Pai 93f0a3f653 Address reviewer comments 2019-03-18 15:37:35 -07:00
Vijay Pai 04a6b8467c Support callback on cancellation of server-side unary RPCs 2019-03-18 12:00:57 -07:00
Vijay Pai 8c3d4a7dfd Merge pull request #18072 from vjpai/client_streaming_hold
C++ callback API: Add support for client-side extra-reaction operations via Holds
2019-03-16 10:27:36 -07:00
Vijay Pai 48ce4ca939 Add support for extra-reaction operations via Holds 2019-03-15 16:17:01 -07:00
Norman Link 3d28761029 Fixing memory leak in interceptor by removing unsued send_status_ 2019-03-13 21:42:02 +01:00
Vijay Pai 05d8ddfc6e Support callback-based generic service 2019-03-04 13:13:12 -08:00
Vijay Pai 2eb25c871e Avoid build errors 2019-02-26 03:08:06 -08:00
Vijay Pai 857e622e6f Merge pull request #18098 from vjpai/try_2
Reduce starting callback counter to exclude client-side StartCall
2019-02-22 19:52:29 -08:00
Vijay Pai 147c61b2a4 Exclude StartCall from starting callback counter value 2019-02-20 21:13:44 -08:00
Yuwei Huang 3cbf4f50ea Remove extra semicolons after function definitions
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.
2019-02-20 17:58:30 -08:00
Nicolas Noble 2ad245cb0c Revert "Folding the Channel class into the grpc_impl namespace." 2019-02-15 09:52:15 -08:00
Yash Tibrewal 73353ad281 Merge branch 'master' into interceptorcleanup1 2019-02-13 12:47:47 -08:00
Yash Tibrewal 50497c2317 Reviewer comments 2019-02-13 12:46:07 -08:00
Nicolas "Pixel" Noble 63db582516 Merge branch 'master' of https://github.com/grpc/grpc into channel 2019-02-13 00:19:23 +01:00
Yash Tibrewal c71b2f4fb7 Global Interceptor Registration allowed only once 2019-02-07 19:36:51 -08:00
Yash Tibrewal 89ee1a8b10 Improved interception docs 2019-02-07 19:18:40 -08:00
Yash Tibrewal 5e2e61b6e5 Note on conditions of usage 2019-01-28 16:37:02 -08:00
Yash Tibrewal 3a2cfe50ec Rever copyright changes 2019-01-28 16:18:49 -08:00
Yash Tibrewal 786598a6ff Merge branch 'master' into interceptorcqavalanching 2019-01-28 11:54:39 -08:00
Yash Tibrewal 9b7b1f4447 Merge pull request #17662 from yashykt/sendmsgintdoc
Update Send message interception methods docs
2019-01-28 11:53:36 -08:00
Yash Tibrewal 9dd8a13439 Restructure code to handle cases exposed by the callback api 2019-01-24 19:03:55 -08:00
Nicolas "Pixel" Noble cabbd35014 Reformat. 2019-01-24 23:42:12 +01:00
Yash Tibrewal 4dcb14ec9e Fix codegen_test_minimal 2019-01-24 13:05:05 -08:00
Yash Tibrewal d347ec7ce0 Register for cq avalanching when interceptors are going to be run 2019-01-23 19:11:51 -08:00
Nicolas "Pixel" Noble 2fd079ff7c Channel folding. 2019-01-23 21:40:07 +01:00
Mehrdad Afshari b12dd1be05 Fix GrpcCodegen initialization
Initializing GrpcCodegen as a global static variable
is problematic because it is possible for it to get
destructed before the last instance of `GrpcLibraryCodegen`
gets destructed and leaves the program dealing with
a dangling pointer (imagine a scenario where another
thread is using gRPC resources and the main thread
tries to join it in an object's destructor after
main ends and CoreCodegen is destructed.)

In fact, Google style guide explicitly forbids
non-trivially-destructible global variables of static
storage duration for this and other reasons and the
solution in this commit is among the recommended
workarounds referenced in
https://google.github.io/styleguide/cppguide.html#Static_and_Global_Variables
2019-01-10 22:12:03 -08:00
Yash Tibrewal 73b1a918e4 Slight update to grammar. Can probably be improved more 2019-01-08 09:28:09 -08:00
Yash Tibrewal b8a542cd23 Update Send message interception methods docs 2019-01-08 09:20:15 -08:00
Vijay Pai 1730c06c48 Merge pull request #17655 from yashykt/callbackwriteoptions
Use the WriteOptions in Client Callback API
2019-01-08 08:15:43 -08:00
Yash Tibrewal 361acdbed1 Use the WriteOptions in Client Callback API 2019-01-07 17:33:16 -08:00
Yash Tibrewal b35b449166 Update docs according to #17630 2019-01-07 17:20:58 -08:00
Yash Tibrewal 34d77aae5e Always nullify serializer to free memory 2019-01-07 14:12:03 -08:00
Yash Tibrewal dd067fd390 Merge branch 'master' into nocopyinterception 2019-01-07 10:09:06 -08:00
Yash Tibrewal 7d1491d64c Address reviewer comments 2019-01-07 09:23:35 -08:00
Yash Tibrewal 059459a9ee Merge branch 'master' into failhijackedrecv 2019-01-04 17:28:25 -08:00
Yash Tibrewal b05ca9697b Merge branch 'master' into failhijackedrecv 2019-01-04 11:30:03 -08:00
Yash Tibrewal 9b9ef64027 Add more information on the usage of FailHijackedRecvMessage 2019-01-04 11:29:57 -08:00
Yash Tibrewal 2b4781ca52 Use Status() instead of Status::OK to avoid issues with codegen_test_minimal 2019-01-03 18:32:10 -08:00
Yash Tibrewal 7eeda22d9e s/two/three 2019-01-03 18:23:15 -08:00
Yash Tibrewal df49204b97 Remove unused variable 2019-01-03 18:10:21 -08:00
Yash Tibrewal 4224384d39 Modifying semantics for GetSendMessage and GetSerializedSendMessage.
Also adding ModifySendMessage
2019-01-03 18:01:58 -08:00
Yash Tibrewal bac79bdabe Merge branch 'master' into failhijackedsend 2019-01-03 15:51:43 -08:00
Yash Tibrewal 50c60f03ba Rename GetSendMessage to GetSerializedSendMessage and GetOriginalSendMessage to GetSendMessage 2019-01-03 12:21:19 -08:00
Yash Tibrewal c6261f4b91 Rename new SendMessage types to SendMessagePtr 2019-01-02 14:46:52 -08:00
Yash Tibrewal 4aeba42528 Provide GetOriginalSendMessage for some APIs 2018-12-28 17:27:38 -08:00
Yash Tibrewal 24e37e249a Merge branch 'master' into failhijackedrecv 2018-12-26 15:10:41 -08:00
Yash Tibrewal 5a6183f1bd Merge branch 'master' into failhijackedsend 2018-12-26 13:33:06 -08:00