hg: jdk7u/jdk7u-dev/jdk: 7126277: Alternative String hashing implementation
mike.duigou at oracle.com
mike.duigou at oracle.com
Thu May 31 00:10:58 PDT 2012
Changeset: 11987e85555f
Author: mduigou
Date: 2012-05-30 23:36 -0700
URL: http://hg.openjdk.java.net/jdk7u/jdk7u-dev/jdk/rev/11987e85555f
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/lang/System.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
! src/share/classes/sun/misc/JavaLangAccess.java
! src/share/classes/sun/util/PreHashedMap.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 jdk7u-dev
mailing list