RFR: 8222532: (zipfs) Performance regression when writing ZipFileSystem entries in parallel

Alan Bateman Alan.Bateman at oracle.com
Tue Apr 23 10:42:32 UTC 2019


On 18/04/2019 14:10, Claes Redestad wrote:
> Hi,
>
> JDK-8034802 changed zipfs to defer deflation to only happen when
> closing/syncing the ZipFileSystem. Previously it happened eagerly when
> closing output streams retrieved via Files.newOutputStream. While this
> behavior change could have positive effects in some cases (since
> reading/writing entries don't need to inflate/deflate on the fly), it
> also broke the ability to deflate entries in parallel.
>
> This patch reverts the behavior so that entries are deflated (by
> default) when individual entry output streams are closed. File channels
> retain the behavior that entries are inflated into an internal byte
> array.
>
> Bug:    https://bugs.openjdk.java.net/browse/JDK-8222532
> Webrev: http://cr.openjdk.java.net/~redestad/8222532/open.00/
I think the approach looks good.

One thing that I think could be improved is ExChannelCloser. I think it 
needs a better name. Also I think it should encapsulate its fields a lot 
better so that sync doesn't need to access its interanls -- e.g. maybe 
it can define a closeAndDelete method that closes the channel and 
deletes the path.

-Alan


More information about the nio-dev mailing list