franz1981 commented on pull request #3405: URL: https://github.com/apache/activemq-artemis/pull/3405#issuecomment-758654800
This one is an easy one: using `switch` enable a nice `String` optimization allowing `javac` to use a `lookupswitch` that has a log(n) cost (with base 2) to lookup at the correct hash code (and I've verified that the hashcode of the cases in the switch have no collisions) + O(n) - n the smaller string to compare to check the specific string equality. Now the thing is: the binary search used by `lookupswitch` is fast enough? I would say yes, but probably only a JMH bench can help here. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
