Bug 40717

Summary: XML forEach tag unacceptably slow
Product: Taglibs Reporter: David Winterbourne <davew>
Component: Standard TaglibAssignee: Tomcat Developers Mailing List <dev>
Severity: major    
Priority: P2    
Version: nightly   
Target Milestone: ---   
Hardware: All   
OS: All   

Description David Winterbourne 2006-10-10 11:41:12 UTC
While profiling our application we identified the JSTL XML forEach tag as a 
serious performance issue. In looking at the implementation it appears that the 
1.1 JSTL XPathUtil class seems to unnecessarily copy every variable from every 
context into an internal object to make the variables available to the XPath 
evaluation object. See 'fillVarStack' in 'selectNodes' method. The JSTL 1.0 
version of XPathUtil doesn't do this at all - it takes a more reasonable 
approach of simply wrapping the original context objects in an object that 
implements the appropriate interface (VariableContext). I would suggest taking 
a similar approach to avoid the unnecessary overhead and garbage created by 
copying all of these objects on every executing of 'doStartTag'.
Comment 1 Henri Yandell 2006-11-06 15:36:23 UTC

*** This bug has been marked as a duplicate of 27717 ***