Skip to content

8265448: Avoid lock contention in reads from zipfs when possible#2

Closed
retronym wants to merge 1 commit intomasterfrom
topic/non-blocking-zipfs
Closed

8265448: Avoid lock contention in reads from zipfs when possible#2
retronym wants to merge 1 commit intomasterfrom
topic/non-blocking-zipfs

Conversation

@retronym
Copy link
Copy Markdown
Owner

@retronym retronym commented Apr 13, 2021

If the given Path represents a file, use the overload of read defined in FileChannel that accepts an explicit position and avoid serializing reads.

Note: The underlying NIO implementation is not required to implement FileChannel.read(ByteBuffer, long) concurrently; Windows still appears to lock, as it return true for NativeDispatcher.needsPositionLock.

On MacOS X, the enclosed benchmark improves from:

Benchmark                    Mode  Cnt   Score   Error  Units
ZipFileSystemBenchmark.read  avgt   10  75.311 ? 3.301  ms/op

To:

Benchmark                    Mode  Cnt   Score   Error  Units
ZipFileSystemBenchmark.read  avgt   10  12.520 ? 0.875  ms/op

@retronym retronym force-pushed the topic/non-blocking-zipfs branch from bbfe195 to fcb7543 Compare May 4, 2021 01:01
@retronym retronym changed the title Avoid lock contention in zipfs 8265448: Avoid lock contention in reads from zipfs when possible May 4, 2021
@retronym retronym force-pushed the topic/non-blocking-zipfs branch 2 times, most recently from df716d7 to 5b1cf0f Compare May 4, 2021 01:09
If the given Path represents a file, use the overload of read defined
in FileChannel that accepts an explicit position and avoid serializing
reads.

Note: The underlying NIO implementation is not required to implement
FileChannel.read(ByteBuffer, long) concurrently; Windows still appears
to lock, as it returns true for NativeDispatcher.needsPositionLock.
@retronym retronym force-pushed the topic/non-blocking-zipfs branch from 5b1cf0f to c288efd Compare May 4, 2021 13:05
@retronym retronym closed this May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant