hg: jdk8/tl/jdk: 7126277: Alternative String hashing implementation

mike.duigou at oracle.com mike.duigou at oracle.com
Thu May 31 05:19:10 UTC 2012

Changeset: 43bd5ee0205e
Author:    mduigou
Date:      2012-05-30 22:18 -0700
URL:       http://hg.openjdk.java.net/jdk8/tl/jdk/rev/43bd5ee0205e

7126277: Alternative String hashing implementation
Summary: All of the hashing based Map implementations: HashMap, Hashtable, LinkedHashMap, WeakHashMap and ConcurrentHashMap are modified to use an enhanced hashing algorithm for string keys when the capacity of the hash table has ever grown beyond 512 entries. The enhanced hashing implementation uses the murmur3 hashing algorithm along with random hash seeds and index masks. These enhancements mitigate cases where colliding String hash values could result in a performance bottleneck.
Reviewed-by: alanb, forax, dl

! make/java/java/FILES_java.gmk
! src/share/classes/java/lang/String.java
! src/share/classes/java/util/HashMap.java
! src/share/classes/java/util/Hashtable.java
! src/share/classes/java/util/LinkedHashMap.java
! src/share/classes/java/util/WeakHashMap.java
! src/share/classes/java/util/concurrent/ConcurrentHashMap.java
+ src/share/classes/sun/misc/Hashing.java
! test/java/util/Collection/BiggernYours.java
! test/java/util/Hashtable/HashCode.java
! test/java/util/Hashtable/SimpleSerialization.java
+ test/java/util/Map/Collisions.java
! test/java/util/Map/Get.java
+ test/sun/misc/Hashing.java

More information about the core-libs-dev mailing list