I have done two set of tests using jms/perf:
I - Transacted, using these properties:
num-messages=150000
num-warmup-messages=10000
message-size=1024
durable=true
transacted=true
batch-size=1000
drain-queue=false
destination-lookup=perfQueue
connection-factory-lookup=/ConnectionFactory
throttle-rate=-1
dups-ok-acknowledge=false
disable-message-id=true
disable-message-timestamp=true
When using AIO: average: 4086.53 msg/s
When using NIO (no Timers): average: 856.07 msg/s
When using NIO (new version with timers): average: 1794.07
II - Non Transacted
num-messages=15000
num-warmup-messages=1000
message-size=1024
durable=true
transacted=false
batch-size=1000
drain-queue=false
destination-lookup=perfQueue
connection-factory-lookup=/ConnectionFactory
throttle-rate=-1
dups-ok-acknowledge=false
disable-message-id=true
disable-message-timestamp=true
AIO: 1751.11 msg/sec
NIO no buffers: 294.97 msg/s
NIO buffers: 301 msg/s
For the transacted case, reusing the commit between producer and consumer really made a difference. NIO improved about 100% after those changes.
For the non-transacted. The tests I did were not significative in terms of finding performance improvements as I would need to add more consumers and producers. But it was good to validate the performance is as good as before at least.
On the process of measuring this I have made a few tweaks, making the TimedBuffer to only call sync when requested (not on every timed flush).
My objective now was to validate the changes and make sure it didn cause a regression instead.
I will do more tests later.