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

XMLWordPrintable

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

      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

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

              Created:
              Updated:
              Resolved: