This is an automated email from the ASF dual-hosted git repository.
nicholasjiang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/celeborn.git
The following commit(s) were added to refs/heads/main by this push:
new 180a74146 [CELEBORN-2100] Fix performance issue on readToReadOnlyBuffer
180a74146 is described below
commit 180a74146c4e4fd462f37faec8c4b17198d10a0f
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]>
---
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) {