Github user michaelandrepearce commented on the issue:
https://github.com/apache/activemq-artemis/pull/1777
Sure, using JMH to measure performance of the two AddressInfo
Implementations.
Benchmark Mode Cnt Score Error
Units
MyBenchmark.testEnumSetAddressInfo thrpt 200 198607467.630 ± 507344.268
ops/s
MyBenchmark.testHashSetAddressInfo thrpt 200 22849376.205 ± 216480.582
ops/s
This is simulating what happens in the hotpath of sending a message in
doSend within ServerSessionImpl. Which is creating an AddressInfo and then
getRoutingType.
As you note the throughput is an order of magnitude of 8x.
Also from a java memory footprint this is far better.
AddressInfo using HashSet with one routing type -> 208 bytes
AddressInfo using HashSet with two routing types -> 240 bytes
AddressInfo using EnumSet with one routing type -> 72 bytes
AddressInfo using EnumSet with two routing types -> 72 bytes
---