[ 
https://issues.apache.org/jira/browse/HADOOP-4813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12655044#action_12655044
 ] 

Doug Cutting commented on HADOOP-4813:
--------------------------------------

As a related matter, I'd like to change the underlying IPC layer to take, 
instead of a Writable a List<ByteBuffer> for requests and return a ByteBuffer 
for responses.  Then we can layer an RPC implementation on top that does not 
copy buffers but rather assembles a list of them.  The simplest implementation 
would allocate new buffers per request, then let them get GC'd.  Such request 
and response buffers should be short-lived and cheap to GC, but if that proves 
to be a problem we could consider pooling them.

> Avoid a buffer copy while replying to RPC requests.
> ---------------------------------------------------
>
>                 Key: HADOOP-4813
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4813
>             Project: Hadoop Core
>          Issue Type: Improvement
>          Components: ipc
>            Reporter: Raghu Angadi
>
> RPC server first serializes RPC response to a ByteArrayOutputStream and then 
> creates a new array to write to socket. For most responses the RPC handler is 
> able to write the entire response in-line. If we could use the same buffer 
> used by ByteArrayOutputStream, we can avoid this copy. 
> As mentioned in HADOOP-4802, yet another copy could be avoided (in most 
> cases) if we use a static direct buffer for the responses (not proposed for 
> this jira).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to