]
Bela Ban commented on JGRP-2076:
--------------------------------
A quick test with {{RoundTrip}} and 20 threads brought the round-trip time down from 205
us to 180 us.
TransferQueueBundler: bundler thread should remove chunks of
messages
---------------------------------------------------------------------
Key: JGRP-2076
URL:
https://issues.jboss.org/browse/JGRP-2076
Project: JGroups
Issue Type: Enhancement
Reporter: Bela Ban
Assignee: Bela Ban
Priority: Minor
Fix For: 3.6.10, 4.0
Currently, the bundler thread in TransferQueueBundler removes messages from the queue one
by one:
{code:java}
while(null != (msg=queue.poll())) {
long size=msg.size();
if(count + size >= transport.getMaxBundleSize())
sendBundledMessages();
addMessage(msg, size);
}
{code}
This is inefficient, as we need to acquire the lock on ArrayBlockingQueue every time.
{{ArrayBlockingQueue.drainTo()}} should be used instead, to remove as many messages as are
in the queue with one lock acquisition.