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

(reflect) Reduce allocations in Class.MethodArray.matchesNameAndDescriptor()

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: 9
    • Fix Version/s: tbd_major
    • Component/s: core-libs
    • Labels:
      None

      Description

      Peter Levart noted:

      "I don't know if this is warranted, since this is on slow path (the resulting methods are cached) and the number of overloaded methods is typically not large, but the following MethodArray method:

      2803 private boolean matchesNameAndDescriptor(Method m1, Method m2) {

      could use a JavaLangAccess bridge to access the Method's parameter types without cloning the array each time. Especially since it's called many times inside nested loop (see removeLessSpecifics()) where the number of invocations grows quadratically with the MethodArray's length. Method.getParameterTypes() is only invoked for pairs of overloaded methods, so this might not be a real issue."

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                darcy Joe Darcy
                Reporter:
                jfranck Joel Borggrén-Franck
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: