Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8178991

Excessive amounts of calls to Flag::find_flag during startup

XMLWordPrintable

      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.

        There are no Sub-Tasks for this issue.

            redestad Claes Redestad
            redestad Claes Redestad
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: