[ 
https://issues.apache.org/jira/browse/HBASE-5945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13546671#comment-13546671
 ] 

stack commented on HBASE-5945:
------------------------------

Looked at Todds hackery again.  Its lovely.  I'd say lets try get it in.

Looking at DD's patch, removing special response and request types looks 
right.... sending the request and response Messages instead w/ method name 
stuff moved up into header (other changes are coming down the pipe I'd say; 
e.g. hbase-7479 removes client protocol version altogether and error should be 
subsumed by response moved from response header .. but for later).

EmptyMsg looks like it already exists.

Is this saving a buffer copy or is it just doing what writeDelimitedTo does?

-          call.param.writeDelimitedTo(this.out);
+          CodedOutputStream cos = CodedOutputStream.newInstance(out,1); 
+          cos.writeRawVarint32(call.rpcRequest.requestArg.getSerializedSize());
+          call.rpcRequest.requestArg.writeTo(cos);
+          cos.flush();

There seem to be classes missing from the patch, ClientSideRpcRequest?

The Todd BufferChain looks nice.  Might as well use it if he has put up the 
code (and a test).  We'll want it for sure when we need to pass encoded data 
blocks after protobuf request/response (HBASE-7233)




                
> Reduce buffer copies in IPC server response path
> ------------------------------------------------
>
>                 Key: HBASE-5945
>                 URL: https://issues.apache.org/jira/browse/HBASE-5945
>             Project: HBase
>          Issue Type: Improvement
>          Components: IPC/RPC
>    Affects Versions: 0.96.0
>            Reporter: Todd Lipcon
>            Assignee: stack
>            Priority: Blocker
>             Fix For: 0.96.0
>
>         Attachments: 5945-in-progress.2.patch, 5945-in-progress.patch, 
> buffer-copies.txt, even-fewer-copies.txt, hbase-5495.txt
>
>
> The new PB code is sloppy with buffers and makes several needless copies. 
> This increases GC time a lot. A few simple changes can cut this back down.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to