]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async/ProtocolV2: optimize append_frame 42285/head
authorOr Ozeri <oro@il.ibm.com>
Sun, 6 Jun 2021 13:55:15 +0000 (16:55 +0300)
committerOr Ozeri <oro@il.ibm.com>
Tue, 13 Jul 2021 13:03:44 +0000 (16:03 +0300)
The commonly used append_frame function currently copies
frame data, incurring expensive heap allocation and data copying.
Instead, switch to claiming the frame data, re-using it without copying.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
src/msg/async/ProtocolV2.cc

index 0f40b32ac46b143448bf594dd70604dc99ec8324..0e4afd2255f781d161530257d5529db5db159053 100644 (file)
@@ -585,7 +585,7 @@ bool ProtocolV2::append_frame(F& frame) {
 
   ldout(cct, 25) << __func__ << " assembled frame " << bl.length()
                  << " bytes " << tx_frame_asm << dendl;
-  connection->outgoing_bl.append(bl);
+  connection->outgoing_bl.claim_append(bl);
   return true;
 }