RFR: 8265448: (zipfs): Reduce read contention in ZipFileSystem [v2]
Alan Bateman
alanb at openjdk.java.net
Wed May 5 16:06:53 UTC 2021
On Wed, 5 May 2021 15:49:00 GMT, Lance Andersen <lancea at openjdk.org> wrote:
>> src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java line 2223:
>>
>>> 2221: synchronized (zfch) {
>>> 2222: n = zfch.position(pos).read(bb);
>>> 2223: }
>>
>> @LanceAndersen Are you planning to look at this? Do you mind checking the async close case to make sure that the synchronization isn't masking anything?
>>
>> Also just to point out that pattern matching for instanceof ca be used here.
>
> Yes, I plan to look at this. It would also be good to have a couple of additional reviews as well :-)
I think using the positional read on the underlying FileChannel is okay. I'm puzzled by the previous code as I would have expected it to restore the position (make me wonder if there are zipfs tests for this).
-------------
PR: https://git.openjdk.java.net/jdk/pull/3853
More information about the nio-dev
mailing list