<div dir="ltr">Submitted as <a href="https://github.com/openjdk/jdk/pull/24176">https://github.com/openjdk/jdk/pull/24176</a><br><br>Jason Zaugg</div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Sat, 22 Mar 2025 at 20:06, Jaikiran Pai <<a href="mailto:jai.forums2013@gmail.com">jai.forums2013@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>
<div>
<p>Hello Jason,</p>
<p>For the proposal to set zipinfo-time=false when constructing the
zipfs FileSystem in the compiler code, I've created
<a href="https://bugs.openjdk.org/browse/JDK-8352642" target="_blank">https://bugs.openjdk.org/browse/JDK-8352642</a>. Since you have
already experimented with the changes, could you create a PR with
just that change for review?</p>
<p>-Jaikiran<br>
</p>
<div>On 17/03/25 10:15 am, Jason Zaugg
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div dir="ltr">On Sun, 16 Mar 2025 at 19:40, Jaikiran Pai <<a href="mailto:jai.forums2013@gmail.com" target="_blank">jai.forums2013@gmail.com</a>>
wrote:</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello
Jason,<br>
<br>
On 02/03/25 7:13 pm, Jason Zaugg wrote:<br>
> I've been analysing the performance of javac in a
relatively large <br>
> codebase and found classpath scanning to be the
dominant factor. There <br>
> are large numbers of compilation tasks, most with long
classpaths <br>
> including large JARs.<br>
><br>
> I've been using the wall-time profiling mode of
async-profiler to <br>
> analyse where time is being spent.<br>
><br>
> I've been able improve build times (most dramatically
on Windows, 750s <br>
> reduced to 350s) by modifying javac to:<br>
><br>
> 1. pass ziptime-info=false to the env Map of <br>
> jarFsProvider.newFileSystem, which means the classpath
scan in the <br>
> constructor of ArchiveContainer need only read the ZIP
central <br>
> directory, rather then reading per-entry Extended Time
metadata.<br>
<br>
I am not familiar with the compiler implementation code, but
speaking in <br>
context of the ZipFileSystem, it appears that this
(undocumented) <br>
"ziptime-info" property of the ZIP file system was indeed
introduced to <br>
help improve the performance of the ZipFileSystem. Setting
it to false <br>
implies that the lastAccessTime() and the creationTime()
returned by the <br>
ZipFileAttributes may not be accurate for some entries,
since settings <br>
this property to false skips reading the per entry creation
and access <br>
time information for the entries. Would you happen to know
if either of <br>
these two methods are used in the code path where you are
proposing to <br>
add "ziptime-info=false"?<br>
<br>
-Jaikiran<br>
</blockquote>
<div><br>
I am not aware of any use of these attributes within javac,
nor does it seem likely that they would be used.</div>
<div><br>
</div>
<div>But the difference in the attributes could be observed by
a client of JavaFileManager that</div>
<div>unwraps the underlying Path from a JavaFileObject
representing a JAR entry.<br>
<br>
```<br>
jshell> var compiler =
javax.tools.ToolProvider.getSystemJavaCompiler();<br>
compiler ==> com.sun.tools.javac.api.JavacTool@4b9e255<br>
<br>
jshell> var fileManager =
compiler.getStandardFileManager(null, null, null)<br>
fileManager ==>
com.sun.tools.javac.file.JavacFileManager@7f416310<br>
<br>
jshell> var head =
fileManager.list(javax.tools.StandardLocation.CLASS_PATH,
"", Set.of(javax.tools.JavaFileObject.Kind.OTHER),
true).iterator().next()<br>
head ==>
JarFileObject[/Users/jz/Library/Caches/Coursier/v ...
e/protobuf/wrappers.proto]<br>
<br>
jshell>
java.nio.file.Files.readAttributes(fileManager.asPath(head),
java.nio.file.attribute.BasicFileAttributes.class)<br>
$11 ==> name :
/google/protobuf/wrappers.proto<br>
creationTime : Fri Feb 14 21:06:54 AEST 2020<br>
lastAccessTime : Fri Feb 14 21:06:54 AEST 2020<br>
lastModifiedTime: Fri Feb 14 21:06:54 AEST 2020<br>
...<br>
```<br>
<br>
A new option could be added to toggle between the existing
and proposed behaviour if this is a concern.</div>
<div><br>
</div>
<div>Regards,</div>
<div><br>
</div>
<div>Jason Zaugg<br>
<br>
</div>
</div>
</div>
</blockquote>
</div>
</blockquote></div>