RFR 8220792: JavacFileManager.list() performance

Jonathan Gibbons jonathan.gibbons at oracle.com
Tue Mar 26 20:33:20 UTC 2019



On 03/18/2019 11:14 AM, Ron Shapiro wrote:
> Hi,
>
> Please review this change to improve the performance of 
> JavacFileManager.list().
>
> bug: https://bugs.openjdk.java.net/browse/JDK-8220792
> webrev: http://cr.openjdk.java.net/~ronsh/8220792/webrev.00/ 
> <http://cr.openjdk.java.net/%7Eronsh/8220792/webrev.00/>
>
> Thanks,
> Ron

Ron,

The idea seems reasonable, but there are some issues with your proposed 
implementation.

Something of a red flag is the need to import Main.Option, when it was 
not needed before. Following that thread, the new maps appear to be 
general, and apply to each Location, but down at the end of the file, 
you reset all the caches if only the CLASS_PATH option is set.  
Moreover, even if the class path is deemed to be special, you only 
interpose when the option is set, and not if the location is set 
directly with any of the setLocation methods are called.

class PathAndContainer implements compareTo but not equals and hashCode,

It's not clear to me why you maintain the list of PathAndContainer as a 
sorted list, and hence why you need to use java.util.List instead of 
javac's List.

-- Jon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20190326/198220f6/attachment.html>


More information about the compiler-dev mailing list