You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by franz1981 <gi...@git.apache.org> on 2018/09/12 15:51:17 UTC

[GitHub] activemq-artemis pull request #2307: ARTEMIS-2070 broker can reduce buffer c...

GitHub user franz1981 opened a pull request:

    https://github.com/apache/activemq-artemis/pull/2307

    ARTEMIS-2070 broker can reduce buffer copies with large messages

    It includes several improvements on large messages:
    
    - AMQP and OpenWire: it reduces the number of copies of the whole file size
    - CORE: it allows to pool the chunks used to stream the message while consuming it
    
    The policy chosen to pool the chunks makes use of the available credits, but can be made less aggressive if is safe enough.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/franz1981/activemq-artemis ARTEMIS-2070

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/activemq-artemis/pull/2307.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2307
    
----
commit ffe494c6f93745fd7ef5ced0b6bbf391b4f43eaf
Author: Francesco Nigro <ni...@...>
Date:   2018-08-31T18:32:48Z

    ARTEMIS-2070 broker can reduce buffer copies with large messages

----


---

[GitHub] activemq-artemis pull request #2307: ARTEMIS-2070 broker can reduce buffer c...

Posted by franz1981 <gi...@git.apache.org>.
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[])..


---

[GitHub] activemq-artemis pull request #2307: ARTEMIS-2070 broker can reduce buffer c...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/activemq-artemis/pull/2307


---

[GitHub] activemq-artemis pull request #2307: ARTEMIS-2070 broker can reduce buffer c...

Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2307#discussion_r217096333
  
    --- 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 --
    
    I'm trying to understand why this was removed? I'm not saying it's wrong.. just trying to understand it. Can  you explain?


---