This is an automated email from the ASF dual-hosted git repository. nicholasjiang pushed a commit to branch branch-0.6 in repository https://gitbox.apache.org/repos/asf/celeborn.git
commit bafd4b3c17424a228d564f725449c2fb833854a7 Author: Jray <[email protected]> AuthorDate: Sat Aug 16 12:56:38 2025 +0800 [CELEBORN-2100] Fix performance issue on readToReadOnlyBuffer ### What changes were proposed in this pull request? Fix performance issue on ReadOnlyByteBuffer::readToReadOnlyBuffer. ### Why are the changes needed? ReadOnlyByteBuffer::readToReadOnlyBuffer now is slow on a long iobuf chain because it used wrong api to clone an iobuf block. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? By compilation and UTs. Closes #3415 from Jraaay/fix/readToReadOnlyBuffer. Authored-by: Jray <[email protected]> Signed-off-by: SteNicholas <[email protected]> (cherry picked from commit 180a74146c4e4fd462f37faec8c4b17198d10a0f) Signed-off-by: SteNicholas <[email protected]> --- cpp/celeborn/memory/ByteBuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/celeborn/memory/ByteBuffer.cpp b/cpp/celeborn/memory/ByteBuffer.cpp index a44ba92bd..e35f662f8 100644 --- a/cpp/celeborn/memory/ByteBuffer.cpp +++ b/cpp/celeborn/memory/ByteBuffer.cpp @@ -84,7 +84,7 @@ std::unique_ptr<ReadOnlyByteBuffer> ReadOnlyByteBuffer::readToReadOnlyBuffer( break; } std::unique_ptr<folly::IOBuf> newBlock = - std::move(this->cursor_->currentBuffer()->clone()); + std::move(this->cursor_->currentBuffer()->cloneOne()); newBlock->pop(); newBlock->trimStart(this->cursor_->getPositionInCurrentBuffer()); if (newBlock->length() > len - cnt) {
