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#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...