-
Enhancement
-
Resolution: Fixed
-
P4
-
None
-
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
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