From 3932a686a97ee7a3896a0058059e899103334b05 Mon Sep 17 00:00:00 2001 From: He Jie Xu Date: Thu, 23 Nov 2023 06:14:19 +0000 Subject: [PATCH] using buffer move instead of copy in IoUringServerSocket::write Signed-off-by: He Jie Xu --- source/common/io/io_uring_worker_impl.cc | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/source/common/io/io_uring_worker_impl.cc b/source/common/io/io_uring_worker_impl.cc index 9d1be3420126..60e7c08de03b 100644 --- a/source/common/io/io_uring_worker_impl.cc +++ b/source/common/io/io_uring_worker_impl.cc @@ -531,14 +531,7 @@ void IoUringServerSocket::write(Buffer::Instance& data) { // We need to reset the drain trackers, since the write and close is async in // the io-uring. When the write is actually finished the above layer may already // release the drain trackers. - // write_buf_.move(data, data.length(), true); - - // We still can't use the move. Since we still have many places use the - // BufferFragment and release them by the drain tracker. This will lose - // a little performance, let us figure out a solution in the future. - write_buf_.add(data); - data.drain(data.length()); - + write_buf_.move(data, data.length(), true); submitWriteOrShutdownRequest(); }