New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ARTEMIS-1606 - Change AddressInfo RoutingType Set to use EnumSet #1777
Conversation
@franz1981 ping. |
01a546d
to
4bc1358
Compare
Change all use from Set<RoutingType> to EnumSet<RoutingType> Deprecating any old exposed interfaces but keeping for back compatibility. Address info to avoid iterator on getRoutingType hotpath, like wise can be avoided where single RoutingType is passed in.
4bc1358
to
dad8da0
Compare
@michaelandrepearce |
@franz1981 did you get a chance to do your local check? you happy for this to merge? |
@michaelandrepearce I'm looking at it locally right now 👍 |
This looks good to me too |
Any metrics to quantify the benefit and justify this change? |
Sure, using JMH to measure performance of the two AddressInfo Implementations. Benchmark Mode Cnt Score Error Units 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 over 8x. Also from a java memory footprint this is far better, note the constant size, and that even with one object its more than half the size (nearly almost a third). AddressInfo using HashSet with one routing type -> 208 bytes AddressInfo using EnumSet with one routing type -> 72 bytes |
Thanks, @michaelandrepearce. Nice results! |
Very good results! A lil OT but seems that we really start need a JMH folder with all the benchs on Artemis eh? :P |
@franz1981 i was waiting on you, to give a thumbs up before i merged, is that a thumbs up? @jbertram cheers. |
@michaelandrepearce I'm running a test before and after, but first can you try add |
Great thanks, ill merge then. |
Change all use from Set
< RoutingType >
toEnumSet<RoutingType>
Deprecating any old exposed interfaces but keeping for back compatibility.
Address info to avoid iterator on getRoutingType hotpath, like wise can be avoided where single RoutingType is passed in.