This is an automated email from the ASF dual-hosted git repository.

chenBright pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brpc.git


The following commit(s) were added to refs/heads/master by this push:
     new f4ffd17f perf: move serialized response IOBuf instead of sharing 
BlockRefs (#3649)
f4ffd17f is described below

commit f4ffd17faaf9f95c6bbb5b75bf87fc2a32509835
Author: nkysg <[email protected]>
AuthorDate: Sat Oct 24 14:10:09 2026 +0800

    perf: move serialized response IOBuf instead of sharing BlockRefs (#3649)
    
    * perf: move serialized response IOBuf instead of sharing BlockRefs
    
    * add comment
---
 src/brpc/policy/baidu_rpc_protocol.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/brpc/policy/baidu_rpc_protocol.cpp 
b/src/brpc/policy/baidu_rpc_protocol.cpp
index 54e61186..173ab24f 100644
--- a/src/brpc/policy/baidu_rpc_protocol.cpp
+++ b/src/brpc/policy/baidu_rpc_protocol.cpp
@@ -1046,8 +1046,9 @@ void ProcessRpcResponse(InputMessageBase* msg_base) {
                 cntl->response_checksum_attachment() ?
                 &cntl->response_attachment() : nullptr;
             if (cntl->response()->GetDescriptor() == 
SerializedResponse::descriptor()) {
+                // res_buf_ptr is not used afterwards; transfer its BlockRefs 
directly.
                 ((SerializedResponse*)cntl->response())->
-                    serialized_data().append(*res_buf_ptr);
+                    serialized_data().append(res_buf_ptr->movable());
             } else if (!DeserializeRpcMessage(*res_buf_ptr, *cntl, 
content_type,
                                               compress_type, checksum_type,
                                               cntl->response(),


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to