Bug 159888 - TaglibHelper.addTEIVariables() opens same jar file about 70 times during project creation
Summary: TaglibHelper.addTEIVariables() opens same jar file about 70 times during proj...
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: jst.jsp (show other bugs)
Version: 1.5   Edit
Hardware: PC Windows XP
: P2 major (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Nick Sandonato CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2006-10-05 11:17 EDT by Naomi Miyamoto CLA
Modified: 2009-04-01 23:07 EDT (History)
6 users (show)

See Also:


Attachments
initial stab at a patch (16.42 KB, patch)
2009-01-28 18:23 EST, Nitin Dahyabhai CLA
no flags Details | Diff
patch (19.36 KB, patch)
2009-04-01 23:06 EDT, Nick Sandonato CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Naomi Miyamoto CLA 2006-10-05 11:17:15 EDT
During project creation, jar files under AppServer/lib are opened about 70 times from TaglibHelper.addTEIVariables().

Call stack example;

	22	java.util.zip.ZipFile.<init>(ZipFile.java:322)
	21	java.util.jar.JarFile.<init>(JarFile.java:168)
	20	java.util.jar.JarFile.<init>(JarFile.java:106)
	19	org.eclipse.jst.jsp.core.internal.taglib.TaglibClassLoader.findClass(TaglibClassLoader.java:247)
	18	java.lang.ClassLoader.loadClass(ClassLoader.java:606)
	17	java.lang.ClassLoader.loadClass(ClassLoader.java:563)
	16	java.lang.Class.forNameImpl(Native Method)
	15	java.lang.Class.forName(Class.java:183)
	14	org.eclipse.jst.jsp.core.internal.taglib.TaglibHelper.addTEIVariables(TaglibHelper.java:203)
	13	org.eclipse.jst.jsp.core.internal.taglib.TaglibHelper.getTaglibVariables(TaglibHelper.java:128)
	12	org.eclipse.jst.jsp.core.internal.java.JSPTranslator.addTaglibVariables(JSPTranslator.java:740)
	11	org.eclipse.jst.jsp.core.internal.java.JSPTranslator.translateXMLNode(JSPTranslator.java:1116)
	10	org.eclipse.jst.jsp.core.internal.java.JSPTranslator.translateRegionContainer(JSPTranslator.java:959)
	9	org.eclipse.jst.jsp.core.internal.java.JSPTranslator.translate(JSPTranslator.java:848)
	8	org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter.getJSPTranslation(JSPTranslationAdapter.java:127)
	7	org.eclipse.jst.jsp.core.internal.java.search.JSPSearchDocument.getJSPTranslation(JSPSearchDocument.java:120)
	6	org.eclipse.jst.jsp.core.internal.java.search.JSPSearchDocument.getPath(JSPSearchDocument.java:160)
	5	org.eclipse.jst.jsp.core.internal.java.search.JavaSearchDocumentDelegate.<init>(JavaSearchDocumentDelegate.java:30)
	4	org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport.createSearchDocument(JSPSearchSupport.java:401)
	3	org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport.addJspFile(JSPSearchSupport.java:295)
	2	org.eclipse.jst.jsp.core.internal.java.search.JSPIndexManager$ProcessFilesJob.run(JSPIndexManager.java:262)
	1	org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
Comment 1 Naomi Miyamoto CLA 2006-10-06 07:23:49 EDT
Hot-bug request information

1. Affiliation: IBM
2. Release you want this bug to be fixed in: 1.5.2
3. Justify why this is a hot bug and why it needs to be fixed in that release:
Performance.
Comment 2 David Williams CLA 2006-10-17 07:34:47 EDT
This is important to investigate, but given definitions for severity in https://bugs.eclipse.org/bugs/page.cgi?id=fields.html#bug_severity
I think "major" better captures the severity. 

Comment 3 David Williams CLA 2006-11-16 11:45:04 EST
I'm not sure this is still literally a "hot bug request", but if so, I'm going to mark it as deferred, since I do not think this is "blocking" adoption. We should still investigate agressively at the "P2" level. And, while "70 times" is obvoiusly a bad thing to do, the bug does not state what time-delay that surfaces to end-user, which is the important measurement. 

So, let's investigate, see what's causing this and see what the actualy end-user performance problem is, before deciding if it is worth some fix in 1.5.3. 
Comment 4 Gary Karasiuk CLA 2006-12-18 13:51:30 EST
What is the status of this defect ... is it going to be fixed in 1.5.3? 
Comment 5 David Williams CLA 2006-12-18 15:34:06 EST
Gary, it's not our top priority, and I'd say likely not to be in 1.5.3. 
The person to whom its assigned is out till after the holidays, so he may 
update the status then. 

And, I might add, no one has answered my implied question in comment #3: 
<quote>And, while "70 times"
is obviously a bad thing to do, the bug does not state what time-delay that
surfaces to end-user, which is the important measurement.
</quote> 


Comment 6 Chris Laffra CLA 2006-12-18 17:15:15 EST
Apparently no one in WTP did as you suggest in #3 to "investigate" this. I, as a consumer, found a problem in this code. It opens all the WebSphere jars 70 times for this particular example. 

I have no direct incentive to study this further, but I would imagine someone in WTP would want to ensure those jars are opened no more than necessary to make JSP translation as fast as possible. 

I can't see how you can say this is not your top priority if you haven't looked at it at all. This defect needs further study before making such conclusion as repetitive I/O is *always* indicative of (a) wasted CPU cycles and (b) flushing of disk caches making other I/O slower.
Comment 7 Nitin Dahyabhai CLA 2008-04-28 16:04:22 EDT
Deferring.

Naomi, do you have a test project that could be used for testing?  Opening the same jar may not be something we can change if it's being done to load *different* class files each time.  If it's being reopened to load the same class file, then we definitely have a problem.
Comment 8 Nitin Dahyabhai CLA 2009-01-28 18:23:38 EST
Created attachment 124112 [details]
initial stab at a patch

Attaching a first effort patch I've had lying around to start off the effort in M6.
Comment 9 Nitin Dahyabhai CLA 2009-01-28 18:33:48 EST
Nick, be sure to test against jars inside the workspace as well as with static inner classes.
Comment 10 Nick Sandonato CLA 2009-04-01 23:06:27 EDT
Created attachment 130645 [details]
patch

Updated Nitin's original contribution.
Comment 11 Nick Sandonato CLA 2009-04-01 23:07:51 EDT
Released to Head.