https://issues.apache.org/bugzilla/show_bug.cgi?id=51276

--- Comment #1 from Alex Dupre <a...@freebsd.org> 2011-05-27 14:49:54 UTC ---
I've debugged the problem and found the issue. This is the incriminated commit:

===
While scanning JARs for TLDs and fragments, avoid using JarFile and use
JarInputStream as in most circumstances where JARs are scanned, JarFile will
create a temporary copy of the JAR rather than using the resource directly.
This change significantly improves startup performance for applications with
lots of JARs to be scanned. (markt)
===

The last sentence is clearly false, since JarFile is optimized for random
access, while JarInputStream has to read the entire file.

I'm attaching a very simple test case, showing the issue. This is a sample
output:

%java TomcatSlowTest webservices-rt.jar
Time elapsed with JarFile (Tomcat 7.0.12): 1 ms
Time elapsed with JarInputStream (Tomcat 7.0.14): 458 ms

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to