You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2021/01/12 11:08:11 UTC

[GitHub] [activemq-artemis] franz1981 opened a new pull request #3405: ARTEMIS-3063 AMQPMessage get property can use a String switch

franz1981 opened a new pull request #3405:
URL: https://github.com/apache/activemq-artemis/pull/3405


   https://issues.apache.org/jira/browse/ARTEMIS-3063


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [activemq-artemis] franz1981 commented on pull request #3405: ARTEMIS-3063 AMQPMessage get property can use a String switch

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [activemq-artemis] asfgit closed pull request #3405: ARTEMIS-3063 AMQPMessage get property can use a String switch

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #3405:
URL: https://github.com/apache/activemq-artemis/pull/3405


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [activemq-artemis] franz1981 edited a comment on pull request #3405: ARTEMIS-3063 AMQPMessage get property can use a String switch

Posted by GitBox <gi...@apache.org>.
franz1981 edited a comment 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:
users@infra.apache.org