RFR: 8286160: (fs) Files.exists returns unexpected results with C:\pagefile.sys because it's not readable [v2]
Brian Burkhalter
bpb at openjdk.java.net
Wed Jun 8 22:40:35 UTC 2022
On Wed, 8 Jun 2022 00:21:21 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
>> If in `WindosFileSystemProvider.checkAccess(Path obj, AccessMode... modes)` the sub-test `checkReadAccess(WindowsPath)` fails and no modes are specified, then try to determine file existence by reading the file's attributes.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>
> 8286160: Move check for existence with no modes specifieds
> > [D]id you do any performance checking compared to the existing code?
>
> No I did not, at least not yet.
Performance measurements for the before and after are as follows:
**Existing Code**
Benchmark (name) Mode Cnt Score Error Units
CheckAccess.exists C:\pagefile.sys thrpt 10 10525.872 ± 247.734 ops/s
CheckAccess.exists C: thrpt 10 11489.428 ± 69.678 ops/s
CheckAccess.exists junk thrpt 10 15368.786 ± 2322.512 ops/s
CheckAccess.isReadable C:\pagefile.sys thrpt 10 9674.403 ± 271.966 ops/s
CheckAccess.isReadable C: thrpt 10 10578.904 ± 201.453 ops/s
CheckAccess.isReadable junk thrpt 10 16072.720 ± 117.358 ops/s
CheckAccess.isWritable C:\pagefile.sys thrpt 10 7211.853 ± 62.367 ops/s
CheckAccess.isWritable C: thrpt 10 919.860 ± 13.846 ops/s
CheckAccess.isWritable junk thrpt 10 832.815 ± 49.616 ops/s
**Modified Code**
Benchmark (name) Mode Cnt Score Error Units
CheckAccess.exists C:\pagefile.sys thrpt 10 11412.256 ± 710.767 ops/s
CheckAccess.exists C: thrpt 10 28780.641 ± 345.568 ops/s
CheckAccess.exists junk thrpt 10 28277.019 ± 219.792 ops/s
CheckAccess.isReadable C:\pagefile.sys thrpt 10 10465.858 ± 176.803 ops/s
CheckAccess.isReadable C: thrpt 10 11343.234 ± 200.306 ops/s
CheckAccess.isReadable junk thrpt 10 17053.404 ± 96.515 ops/s
CheckAccess.isWritable C:\pagefile.sys thrpt 10 7713.395 ± 89.954 ops/s
CheckAccess.isWritable C: thrpt 10 989.610 ± 5.155 ops/s
CheckAccess.isWritable junk thrpt 10 873.649 ± 6.802 ops/s
The updated code shows higher throughput for all tests, and substantially higher for a couple of the `exists()` test.
-------------
PR: https://git.openjdk.java.net/jdk/pull/9045
More information about the nio-dev
mailing list