-
Enhancement
-
Resolution: Fixed
-
P4
-
None
-
1.4.2
-
x86
-
windows_xp
Name: rmT116609 Date: 06/04/2003
FULL PRODUCT VERSION :
java version "1.4.2-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-beta-b19)
Java HotSpot(TM) Client VM (build 1.4.2-beta-b19, mixed mode)
FULL OS VERSION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
During class- and resource-loading methods java.util.jar.JarFile.getEntry() and java.util.zip.ZipFile.getEntry() will be called for every JAR in the CLASSPATH until the class or resource is found.
If there is no entry in the JAR with the name passed to the method, java.util.zip.ZipFile.getEntry() will append a '/' to the name and try again.
This happens quite often, especially with many classes and many JARs, and the String-concatenation causes lots of char[], String and StringBuffer objects to be allocated and garbage-collected.
Since trying a directory name does not make sense when loading classes and resources with fully specified names, I suggest implementing methods JarFile.getFileEntry() and ZipFile.getFileEntry(), which only look for files and should be used for class and resource-loading.
(Review ID: 186926)
======================================================================
- relates to
-
JDK-8242959 Optimize ZipFile.getEntry by folding lookups for name and name+'/'
-
- Resolved
-