LI123456mo opened a new pull request, #16071:
URL: https://github.com/apache/dubbo/pull/16071

   **Problem:** Currently, the DataQueueCommand in the Triple protocol uses 
byte[] for data transfer. This triggers a System.arraycopy inside the 
writeBytes() call when stitching the frame header with the payload. For large 
messages or high-throughput scenarios, this constant memory copying creates 
significant CPU overhead.
   
   Solution: This PR refactors the outbound data path to support Zero-Copy 
transport:
   
   DataQueueCommand: Updated to use Netty ByteBuf. It now uses CompositeByteBuf 
to stitch the 5-byte Triple header and the message payload without performing a 
memory copy.
   
   Transport Bridge: Updated AbstractTripleClientStream to wrap outgoing 
payloads in Unpooled.wrappedBuffer. This ensures that even though the upper 
layers still use byte[], the transport layer handles them as buffers, enabling 
"gathering writes."
   
   Why I limited the scope: I have intentionally avoided modifying the 
PackableMethod and Compressor interfaces in this PR. Updating them to ByteBuf 
or ByteBuffer would require breaking public APIs and introducing Netty 
dependencies into core modules. I believe this PR provides the necessary 
infrastructure for Zero-Copy first; we can discuss evolving the 
Serialization/Compression layers in a separate follow-up to keep this change 
safe and backward-compatible.
   
   Tests: Verified that dubbo-rpc-triple compiles and core transport logic 
remains intact.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to