JDK-8178991 : Excessive amounts of calls to Flag::find_flag during startup
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2017-04-20
  • Updated: 2017-07-19
  • Resolved: 2017-07-19
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
10Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Sub Tasks
JDK-8179224 :  
Description
in Thread::create_vm we call

CommandLineFlagRangeList::check_ranges()
and CommandLineFlagConstraintList::check_constraints(CommandLineFlagConstraint::AfterErgo)

which together cause more than 302k strlen calls, a fraction of that strcmps for a total of about ~14M instructions, or 4% of the total, in a Hello World startup test (comparing a build where these calls are commented out). The cost is O(n*m), where n is the number of constraints and m is the total number of flags.

While a very small regression (~0.5-1.5ms) there are a number of ways to improve this, such as sorting the constraints and flag table so that we could do the scan in O(n+m) time. 
Comments
This issue was effectively resolved by JDK-8180614
19-07-2017