Observation: The cost of using NIO BasicFileAttributes in ZipFile.Source.Key

Eirik Bjørsnøs eirbjo at gmail.com
Mon Jan 26 17:07:24 UTC 2026


On Mon, Jan 26, 2026 at 5:07 PM Alan Bateman <alan.bateman at oracle.com>
wrote:

Alan,

I don't think we should go back to that.


I was not suggesting we ditch the file key information from Key, that was
more to demonstrate the change in class loading.


>  Actually, anything non-trivial causes these classes to be loaded.
>

Granted, although many useful programs are indeed trivial!

I don't think that would make sense to expose on the legacy File class.


Okay. I'd be happy with a private API point that wasn't so eager to load
these classes at startup.

For reference, "java -cp hello.jar Hello" runs in ~62 ms on the mainline.
On a branch using a non-NIO "file key" API, it runs in ~58.
So startup impact is significant.

But the appetite seems meager, so I don't plan to kick this ball any
further.

Cheers,
Eirik.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20260126/3155a72b/attachment.htm>


More information about the core-libs-dev mailing list