|Summary:||XML forEach tag unacceptably slow|
|Product:||Taglibs||Reporter:||David Winterbourne <davew>|
|Component:||Standard Taglib||Assignee:||Tomcat Developers Mailing List <dev>|
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'.