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

ASF GitHub Bot commented on ARTEMIS-2070:
-----------------------------------------

Github user franz1981 commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2307#discussion_r217143867
  
    --- Diff: 
artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientMessageImpl.java
 ---
    @@ -400,17 +398,10 @@ public long getLargeBodySize() {
           }
     
           @Override
    -      public int encode(final ByteBuffer bufferRead) throws 
ActiveMQException {
    -         ActiveMQBuffer buffer1 = 
ActiveMQBuffers.wrappedBuffer(bufferRead);
    -         return encode(buffer1, bufferRead.capacity());
    -      }
    -
    -      @Override
    -      public int encode(final ActiveMQBuffer bufferOut, final int size) {
    --- End diff --
    
    Yes, it's a legit question :)
    It has been removed because it isn't used anymore: the version (that 
already exists) with just ByteBuffers is enough for the purpose and it will 
save 3 wrapped instances (ChannelBufferWrapper+ 2 types of ByteBuf) that aren't 
needed by sequentialFile::writeDirect.
    In addition it will make the code shorter  and with less checks about what 
ActiveMQBuffer contains (ie byte[])..


> broker can reduce buffer copies with large messages
> ---------------------------------------------------
>
>                 Key: ARTEMIS-2070
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2070
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>          Components: Broker
>            Reporter: Francesco Nigro
>            Assignee: Francesco Nigro
>            Priority: Major
>
> While dealing with large messages, regardless of the protocol used, the 
> broker is performing several buffer copies that could be saved to make the 
> process less memory hungry, in particular when AMQP or OpenWire are used.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to