From 94ca7736da1b935ff07cb26920e9150abd11fafd Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 7 Sep 2020 14:05:20 +0800 Subject: [PATCH] common/buffer_seastar: reserve the packet slots in ctor for better performance, and simpler this way Signed-off-by: Kefu Chai --- src/common/buffer_seastar.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/common/buffer_seastar.cc b/src/common/buffer_seastar.cc index 8d77cf8f6b67..7d0e98e379a9 100644 --- a/src/common/buffer_seastar.cc +++ b/src/common/buffer_seastar.cc @@ -74,8 +74,7 @@ ptr::operator seastar::temporary_buffer() && list::operator seastar::net::packet() && { - seastar::net::packet p; - p.reserve(_num); + seastar::net::packet p(_num); for (auto& ptr : _buffers) { // append each ptr as a temporary_buffer p = seastar::net::packet(std::move(p), std::move(ptr)); -- 2.47.3