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

Rob Godfrey commented on QPID-6787:
-----------------------------------

One small optimization you can make, in 
BasicContentHeaderProperties.writePropertyListPayload(final QpidByteBuffer 
buffer)  you can replace 

{code}
           final QpidByteBuffer duplicate = _encodedForm.duplicate();
           buffer.put(duplicate);
           duplicate.dispose();
{code}

with

{code}
           buffer.putCopyOf(_encodedForm);
{code}

This removes the need to create a temporary QBB and the associated reference 
counting.

> Prevent unnecessary buffer copies/buffer allocations when storing metadata 
> (0-8..0-91)
> --------------------------------------------------------------------------------------
>
>                 Key: QPID-6787
>                 URL: https://issues.apache.org/jira/browse/QPID-6787
>             Project: Qpid
>          Issue Type: Improvement
>          Components: Java Broker
>            Reporter: Keith Wall
>            Assignee: Rob Godfrey
>             Fix For: qpid-java-6.0
>
>         Attachments: 
> 0001-QPID-6787-Prevent-unnecessary-buffer-copies-buffer-a.patch
>
>
> {{org.apache.qpid.framing.BasicContentHeaderProperties#writePropertyListPayload(java.io.DataOutput)}}
>  takes a copy of the encoded form buffer before writing the copy to the 
> destination.  It is possible to eliminate this copy and a few intermediary 
> DataOutput objects.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to