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

Improve the performance of MethodTypeDesc::descriptorString

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 21
    • 21
    • core-libs
    • b26

      The current MethodTypeDesc implementation has a few performance issues. Below are the actionable changes that I recommend:

      1. MTD can cache the descriptorString as computation is expensive; and its descriptorString computation can be improved by removing streams and formatting.
      2. MTD doesn't have to validate all its arguments (to be non-void) every time a new instance is created, especially for return type swapping and parameter dropping.
      3. Since parameterList will be costly, we should replace a few of its occurrences in performance-sensitive area with manually-unrolled loops.

      This will most likely replace bug 8306889.

      Also a few general side notes:
      1. MTD parsing from descriptor is costly, so we can construct from CDs instead, especially if we don't use the descriptor.
      2. As a conclusion, MTD should be stored in static final fields in use sites (like constants), such as in SystemModulesPlugin; this will be done in a separate patch.

            liach Chen Liang
            liach Chen Liang
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: