franz1981 commented on pull request #3363:
URL: https://github.com/apache/activemq-artemis/pull/3363#issuecomment-736245035


   The new hash code implementation should help in other places as well, but 
probably will send a new PR to address it, FYI
   ```
   Benchmark                                      (length)  (logPermutations)  
(seed)  (unsafe)  Mode  Cnt   Score   Error  Units
   ByteArrayHashCodeBenchamark.arraysHashCode            7                  4   
    0      true  avgt   16  10.790 ± 0.089  ns/op
   ByteArrayHashCodeBenchamark.arraysHashCode            7                 10   
    0      true  avgt   16  11.155 ± 0.284  ns/op
   ByteArrayHashCodeBenchamark.arraysHashCode            8                  4   
    0      true  avgt   16  11.501 ± 0.037  ns/op
   ByteArrayHashCodeBenchamark.arraysHashCode            8                 10   
    0      true  avgt   16  11.901 ± 0.380  ns/op
   ByteArrayHashCodeBenchamark.arraysHashCode           36                  4   
    0      true  avgt   16  37.772 ± 0.202  ns/op
   ByteArrayHashCodeBenchamark.arraysHashCode           36                 10   
    0      true  avgt   16  38.580 ± 1.283  ns/op
   ByteArrayHashCodeBenchamark.bytesUtilHashCode         7                  4   
    0      true  avgt   16   8.337 ± 0.088  ns/op
   ByteArrayHashCodeBenchamark.bytesUtilHashCode         7                 10   
    0      true  avgt   16   8.393 ± 0.056  ns/op
   ByteArrayHashCodeBenchamark.bytesUtilHashCode         8                  4   
    0      true  avgt   16   7.066 ± 0.022  ns/op
   ByteArrayHashCodeBenchamark.bytesUtilHashCode         8                 10   
    0      true  avgt   16   7.151 ± 0.096  ns/op
   ByteArrayHashCodeBenchamark.bytesUtilHashCode        36                  4   
    0      true  avgt   16  13.721 ± 0.842  ns/op
   ByteArrayHashCodeBenchamark.bytesUtilHashCode        36                 10   
    0      true  avgt   16  13.437 ± 0.078  ns/op
   ```
   The 8 bytes case is in case duplicate ids are 64 bit sequence ids while the 
36 bytes case in case of a random UUID,
   It's a lot more faster then the OOTB version of `Arrays::hashCode` (on JDK 
8).


----------------------------------------------------------------
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]


Reply via email to