RFR: JDK-8189611: JarFile versioned stream and real name support

Xueming Shen xueming.shen at oracle.com
Fri Nov 17 02:18:43 UTC 2017


Hi,

Please help review the change for JDK-8189611.

issue: https://bugs.openjdk.java.net/browse/JDK-8189611
webrev: http://cr.openjdk.java.net/~sherman/8189611/webrev


Notes:

(1) To add three public methods to help iterating/streaming the 
versioned entries
for multi-release jar file support (CSR is to be filed)

JavaFile.versionedStream()
JavaFile.getRealName()
ZipFile.entryNameStream()
   -- a convenient method for use scenario that only the entry name is 
interested.

(2) To update jdk code( jlink, module, loader, where currently the 
internal/private
methods are used) to use the new public methods for "versionedStream()" and
"getRealName()" need. (jdeps is not being updated for now as it is now 
compiled
by boot jdk).

(3) To cleanup the way how the JarFileEntry and its corresponding 
versioned one
are searched and created. By pushing the JarFileEntry constructor into 
ZipFile via
SharedSecrets, we are now using much less memory (almost half) for 
JarFileEntry
creation and have a slightly faster iteration (around 10% by jmh simple 
benchmark).

(4) To add a fast-path in ZipCoder for UTF8 charset+ascii-only entry 
name. To
take the advantage of the compact String to remove the unnecessary 
char[] usage.
This is related to JDK-8184947: ZipCoder performance improvements

(5) Two snapshots of the JFR recording of the memory usages for simply 
looping the
JarFile.stream() on old rt.jar for 60s,  before and after the change of 
(3)/(4)

http://cr.openjdk.java.net/~sherman/8189611/mem_before.png
http://cr.openjdk.java.net/~sherman/8189611/mem_after.png

Thanks,
Sherman




More information about the core-libs-dev mailing list