Skip to content

Commit

Permalink
using buffer move instead of copy in IoUringServerSocket::write
Browse files Browse the repository at this point in the history
Signed-off-by: He Jie Xu <hejie.xu@intel.com>
  • Loading branch information
soulxu committed Nov 23, 2023
1 parent ab8fa48 commit 3932a68
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions source/common/io/io_uring_worker_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit 3932a68

Please sign in to comment.