On Sun, 23 Mar 2025 12:38:04 GMT, Jason Zaugg <jza...@openjdk.org> wrote:
> zipfs has a (undocumented) property "zipinfo-time" which was introduced in > https://bugs.openjdk.org/browse/JDK-8150496 to help improve performance of > the ZipFileSystem. When a ZipFileSystem is created with this property's value > set to "false", then the implementation in ZipFileSystem, while constructing > the entries from the ZIP file will skip reading the access time and the > creation time of each ZIP entry from the entry's LOC header. This improves > the performance of zipfs, since when reading the CEN, it no longer has to > traverse to individual LOC headers to find the access time and creation time > values of each entry. > > Setting "zipinfo-time" = false, thus implies that the > ZipFileAttributes.creationTime() and ZipFileAttributes.lastAccessTime() APIs > may not return the right values when used against Path(s) corresponding to > the ZIP entries in that FileSystem. Not all usages of zipfs require or use > the creationTime()/lastAccessTime() APIs. Such usages can set "zipinfo-time" > = false and benefit from improved performance. > > com.sun.tools.javac.file.JavacFileManager$ArchiveContainer is one such place > where when constructing the FileSystem, it could pass this property. This is > especially useful since this part of the code in practice can be dealing with > large number of jar files in the classpath and creating one zipfs FileSystem > for each such JAR file. > > It has been reported in the compiler-dev mailing list, that an experiment to > set "zipinfo-time" = false in this part of the code has shown very noticeable > performance improvements, especially on Windows, when dealing with large > classpath. Details in the thread here > https://mail.openjdk.org/pipermail/compiler-dev/2025-March/029529.html. This pull request has now been integrated. Changeset: d9b6e4b1 Author: Jason Zaugg <jza...@openjdk.org> Committer: Jaikiran Pai <j...@openjdk.org> URL: https://git.openjdk.org/jdk/commit/d9b6e4b13200684b69a161e288b9883ff0d96bec Stats: 10 lines in 1 file changed: 7 ins; 0 del; 3 mod 8352642: Set zipinfo-time=false when constructing zipfs FileSystem in com.sun.tools.javac.file.JavacFileManager$ArchiveContainer for better performance Reviewed-by: liach, jpai, jlahoda, lancea ------------- PR: https://git.openjdk.org/jdk/pull/24176