JDK-7030453 : JSR 292 ClassValue.get method is too slow
Type:Bug
Component:hotspot
Sub-Component:compiler
Affected Version:7
Priority:P3
Status:Resolved
Resolution:Fixed
OS:generic
CPU:generic
Submitted:2011-03-23
Updated:2013-04-30
Resolved:2012-01-27
The Version table provides details related to the release that this issue/RFE will be addressed.
Unresolved : Release in which this issue/RFE will be addressed. Resolved: Release in which this issue/RFE has been resolved. Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.
Now that ClassValue is in the java.lang package, it should be co-optimized with Class, just as ThreadLocal is co-optimized with Thread.
Comments
EVALUATION
http://hg.openjdk.java.net/hsx/hotspot-main/jdk/rev/92d2cba30f08
Technical discussion of the fix may be found here:
http://mail.openjdk.java.net/pipermail/mlvm-dev/2011-September/003930.html
This bug is mainly a performance bug, due to the use of a global table (keyed by Class) instead of a direct link (from a non-public field in Class). The global table also introduces race conditions, at least potentially, when mapping from a new Class key to a stable root for the Class's ClassValue set.