Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8086045 Improve the java.lang.invoke first initialization costs
  3. JDK-8163370

Reduce number of classes loaded by common usage of java.lang.invoke

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:

      Description

      Various code constructs in java.lang.invoke pull in an excessive amount of classes early during bootstrap. Some non-intrusive refactorings can reduce the number of classes we depend on and load early.

      Examples:

      - Using an EnumMap<Wrapper, MethodHandle> in sun.misc.invoke.ValueConversions pulls in 5 EnumMap-related classes. Additionally calling values() on an enum class to get the number of enum creates and loads an array class and cause a clone to be allocated every time, which is detrimental to startup performance.
      - Using result.addAll(Arrays.asList(buf).subList(0, bufCount)) rather than a simple for-loop pulls in 5 classes

        Attachments

          Activity

            People

            Assignee:
            redestad Claes Redestad
            Reporter:
            redestad Claes Redestad
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: