Performance of JrtFileSystemProvider.exists

Jason Zaugg jzaugg at
Thu Feb 16 08:15:33 UTC 2017

Recently I modified the Scala compiler to read class files
jrt:/ filesystem, rather than relying on rt.jar.

I noticed a slowdown when running on JDK 9 ea and exercising this code.
Profiles suggest that the bottleneck is in calls to Files.exists.
JrtFileSystemProvider inherits an implementation which needs to construct,
throw and catch NoSuchFileException to answer in the negative.

It is possible that I'm calling this more often than needed, and could
implement a caching layer. But it seems worthwhile for jrtfs to implement a
fast path for exists, as is done in UnixFileSystemProvider.

Possibly related bug "Startup regression with Jython":


Jason Zaugg

More information about the jigsaw-dev mailing list