JDK-8150496 : (zipfs) Fix performance issues in zip-fs
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2016-02-24
  • Updated: 2025-03-28
  • Resolved: 2016-05-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b118Fixed
Related Reports
Relates :  
Relates :  
Description
From an email thread:


A quick System.nanoTime() measuring of

        try (FileSystem fs = FileSystems.newFileSystem(
                          new URI("jar", ...),  Collections.emptyMap())) {}

        try (ZipFile zf = new ZipFile(args[0])) {}

on rt.jar suggests zipfile initialization is about 5 times faster than zipfs's.
Something need to be done.

Comments
URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/b9ed1a4feefb User: lana Date: 2016-05-11 16:05:08 +0000
11-05-2016

URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/b9ed1a4feefb User: sherman Date: 2016-05-06 21:03:37 +0000
06-05-2016

We are improving the performance for most of the path related access methods. init() cost still remains as an issue with relative small improvement. However the implementation analysis suggests that the most significant time spent is for (1) copy the entry name out of the cen and (2) build a node tree to enable the zip be accessed as a "file system". The name copy part is more like a "eager initialization" cost as the zipfs then no longer need to copy the name out cen everytime an entry is requested (ZipFile on the other hand needs to do the name copy everytime an entry is requested). So this might be something the zipfs just pays in advance. (2) is kinda of inevitable as the zipfs has to prepare itself to be accessed as a "file system".
02-05-2016