OpenHFT / Zero-Allocation-Hashing

Zero-allocation hashing for Java
Apache License 2.0
787 stars 136 forks source link

use jdk native Math.multiplyHigh() to improve performance #42

Closed gzm55 closed 4 years ago

gzm55 commented 4 years ago

From JDK10, Math.multiplyHigh() is optimized as hardware instructions on x86 and arm. This can improve the performance of 64x64_fold mix steps, which is used in many good hash, such as xx3, tiha, wyhash, mum and etc. On my local test, the wy_3() is improved significantly.

Math.multiplyHigh() was introduced from JDK9, so we need some tricks for compiling on JDK7&8, and avoid method reflection invocations.

gzm55 commented 4 years ago

@RobAustin which version of JDK do we use to build the release artifacts?

dpisklov commented 4 years ago

Java 8, oracle's jdk

On Sat, 14 Mar 2020, 15:07 James Z.M. Gao, notifications@github.com wrote:

@RobAustin https://github.com/RobAustin which version of JDK do we use to build the release artifacts?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/OpenHFT/Zero-Allocation-Hashing/issues/42#issuecomment-599076364, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3U7SH2QGZX6D524FAPO53RHOMSNANCNFSM4LG2RHMA .