From: Or Ozeri Date: Sun, 6 Jun 2021 13:55:15 +0000 (+0300) Subject: msg/async/ProtocolV2: optimize append_frame X-Git-Tag: v17.1.0~1412^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F42285%2Fhead;p=ceph.git msg/async/ProtocolV2: optimize append_frame 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 --- diff --git a/src/msg/async/ProtocolV2.cc b/src/msg/async/ProtocolV2.cc index 0f40b32ac46b..0e4afd2255f7 100644 --- a/src/msg/async/ProtocolV2.cc +++ b/src/msg/async/ProtocolV2.cc @@ -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; }