Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 293992

Summary: [validation] JSPBatchValidator is taking substantially longer when needed taglibs are not on class path
Product: [WebTools] WTP Source Editing Reporter: Ian Tewksbury <itewksbu>
Component: jst.jspAssignee: Ian Tewksbury <itewksbu>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3 CC: david_williams, nsand.dev
Version: 3.0.5Flags: nsand.dev: review+
Target Milestone: 3.0.5 P   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Fix Patch none

Description Ian Tewksbury CLA 2009-11-02 16:02:16 EST
TaglibHelper#isIterationTag and TaglibHelper#addTEIVariables both call Class#forName.  This method uses a class loader to load a class of a given name.  The first time a class is loaded the class loader has to go searching through the class path for the class.  This is not a problem if the class is there, but if its not it has to search through the entire class path looking for it and once its figured out the class is not on the class path the class loader has no way of caching that the class can not be loaded, it only caches whats loaded.  Therefor as its implemented now for each tag whos backing class can not be found, every time that tag is encountered the TaglibHelper searches through the entire class path again just to find out the class can not be found.  This is an expensive operation causing large (500MB+ Projects) who don't have their dependencies in the workspace to take over 5 hours to validate (on a 4 core machine).

The fix is to have a cache in the TaglibHelper of classes that were not found by the class loader.  Because the TaglibHelper gets trashed and recreated every time the classpath changes the cache will also be wiped out assuring it wont become stale.

This fix takes that 5 hour+ running time down to 17 minutes.  The running time on this particular project with all of its dependencies in the workspace is 10 minutes.  The extra 7 minutes is due to still having to search through the entire class path for ONCE for each tag whos backing class can not be found.

Patch to follow.
Comment 1 Ian Tewksbury CLA 2009-11-02 16:08:17 EST
Created attachment 151121 [details]
Fix Patch

Adds the cache to TaglibHelper as described in comment #1
Comment 2 Nick Sandonato CLA 2009-11-02 17:11:02 EST
Patch looks OK to me.
Comment 3 David Williams CLA 2009-11-05 10:33:45 EST
applied to 305 patches >= P20091105081118

Please make sure the fix is carried forward to future streams, if not already. 

Thanks,
Comment 4 Ian Tewksbury CLA 2009-11-05 10:44:07 EST
Thanks a bunch!

Fix for WTP 3.2 being tracked by Bug 293998