JDK-8178543 : Optimize Klass::is_shared()
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2017-04-12
  • Updated: 2017-08-25
  • Resolved: 2017-04-26
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.

To download the current JDK release, click here.
JDK 10
10 b21Fixed
Related Reports
Relates :  
Description
During itable/vtable initialization, klass->is_shared() is called frequently. Because there's no specialized implementation of Klass::is_shared(), we end up calling MetaspaceObj::is_shared, which walks the list of shared regions.

JDK-8178351 proposes simplifying MetaspaceObj::is_shared() by doing fewer comparisons. However, in the case of Klass, we can actually use a free bit in Klass::_access_flags to indicate whether the Klass is shared, so we can have an even more optimal implementation of Klass::is_shared().
Comments
Preliminary testing shows the following improvement for one particular start-up benchmark that loads many classes (AppCDS enabled). config 1: 694 ms -> 676 ms (2.6% improvement) config 2: 694 ms -> 669 ms (3.6% improvement)
12-04-2017