RFR(S): 8087143: Reduce Symbol::_identity_hash to 2 bytes
Yumin Qi
yumin.qi at oracle.com
Thu Jun 18 20:46:50 UTC 2015
Please review the small change for
bug: https://bugs.openjdk.java.net/browse/JDK-8087143
webrev: http://cr.openjdk.java.net/~minqi/8087143/webrev01/
Summary: _identity_hash is an integer in Symbol (SymbolBase), it is used
to compute hash bucket index by modulus division of table size.
Currently in hotspot, no table size is more than 65535 so we can use
short instead. For case with table size over 65535 we can use the first
two bytes of symbol data to be as the upper 16 bits for the calculation
but rare cases.
This is a minor change, also eliminates SymbolBase which seems
redundant. Also add print out SymbolTable statistics under debug flag
PrintSystemDictionaryAtExit.
Tests: JPRT, Specjbb2005.
The SymbolTable statistics for specjbb2005:
Before Change:
SymbolTable statistics:
Number of buckets : 20011 = 320176 bytes, avg 16.000
Number of entries : 49914 = 1597248 bytes, avg 32.000
Number of literals : 49914 = 1709688 bytes, avg 34.253
Total footprint : = 3627112 bytes
Average bucket size : 2.494
Variance of bucket size : 2.483
Std. dev. of bucket size: 1.576
Maximum bucket size : 10
After Change:
SymbolTable statistics:
Number of buckets : 20011 = 320176 bytes, avg 16.000
Number of entries : 49911 = 1597152 bytes, avg 32.000
Number of literals : 49911 = 1709544 bytes, avg 34.252
Total footprint : = 3626872 bytes
Average bucket size : 2.494
Variance of bucket size : 2.483
Std. dev. of bucket size: 1.576
Maximum bucket size : 10
There is no big change for the hashtable balance.
Thanks
Yumin
More information about the hotspot-runtime-dev
mailing list