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

Allocate fewer EnumSets in JavacFileManager#list

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 13
    • None
    • tools
    • b03

      My colleague Ron Shapiro reports that in a large real-world compilation FileManager#list spent ~500ms allocating EnumSets at these sites:

      http://hg.openjdk.java.net/jdk/jdk/file/02e648ae46c3/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JavacFileManager.java#l520

      http://hg.openjdk.java.net/jdk/jdk/file/02e648ae46c3/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JavacFileManager.java#l520

      Extracting the enums to a constant (the same approach used for sourceOrClass earlier in that class [1]) is a modest performance improvement.

      [1] http://hg.openjdk.java.net/jdk/jdk/file/02e648ae46c3/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JavacFileManager.java#l107

            cushon Liam Miller-Cushon
            cushon Liam Miller-Cushon
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: