[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: Message Chunking Performance problems

clebert.suconic@jboss.com do-not-reply at jboss.com
Tue Aug 26 10:06:57 EDT 2008


Why do we still need PacketImpl.INITIAL_BUFFER_SIZE?

We can aways calculate how many bytes we need to send any of our packets. On ClientMessages, we just get the getEncodeSize(), and add a few bytes... Most of the other Packets have constant sizes.

Looking at RemotingConnectionImpl:

   private void doWrite(final Packet packet)
  |    {
  |       if (destroyed)
  |       {
  |          throw new IllegalStateException("Cannot write packet to connection, it is destroyed");
  |       }
  | 
  |       MessagingBuffer buffer = transportConnection.createBuffer(PacketImpl.INITIAL_BUFFER_SIZE);
  | 
  |       packet.encode(buffer);
  | 
  |       transportConnection.write(buffer);
  |    }
  | 
  | 

We could add the getEncodeSize() on the Packet interface... a parameter with the size on doWrite... any other similar thing as long as we don't allocate buffers to later dispose then. At the rates we are achieving with JBossMessaging the Buffer alloc times really matters (on the tests I have made so far).



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4172592#4172592

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4172592



More information about the jboss-dev-forums mailing list