RFR: 8208077: File.listRoots performance degradation

Brian Burkhalter bpb at openjdk.org
Wed Jan 18 16:21:14 UTC 2023


On Wed, 18 Jan 2023 14:16:22 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> The Windows implementation of File.listRoots was changed in JDK 10 to test the root directory of each "logical drive" to see that it exists. The motive was to filter out drive letters corresponding to removable media where the media is not present. This is problematic for a number of reasons that include performance (esp. for mapped drives), inconsistency with FileSystem::getRootDirectories, and surprising behavior when media is re-inserted. After re-examining this area again, the best thing seems to be just undo this change so that File.listRoots doesn't attempt to do the problematic filtering.

Comparing to `FileSystem::getRootDirectories` is good.

-------------

Marked as reviewed by bpb (Reviewer).

PR: https://git.openjdk.org/jdk/pull/12072


More information about the core-libs-dev mailing list