On 12/07/2010 06:40, Jeremy Boynes wrote:
> Implementation seems to work but does not provide as much benefit as 
> expected. Jasper tag pooling does not pool tags with the same attribute 
> values so the select attribute is set every time causing recompilation. The 
> time taken to iterate 1000 <x:out> tags drops from around 2800ms to 1800ms.

Providing the same attributes with the same values are present, Jasper
should be pooling the tags. There was a bug in this area [1] but it was
fixed some time ago. If this isn't the case then please open a Tomcat
bug and provide a test case.

> To work around this I added a thread-local cache of compiled XPath 
> expressions. This does reduce the initial time taken for the first few 
> iterations but the time taken to evaluate the compiled expression grows from 
> 500us to 2100us toward the end of the loop (measured with nanoTime() around 
> the call to evaluate). There may be some issue with Xalan; the same behaviour 
> is seen with Sun's JAXP implementation included in JDK1.6 (which is based on 
> Xalan).

Use of ThreadLocals in this way is almost certainly going to trigger
memory leaks on web application reload.

> The same slowdown is seen if the expression is evaluated each time, or if the 
> xpath is run in a standalone testcase outside taglibs entirely. There may be 
> an issue here with Xalan and/or the JDK.
> 
> We might be advised to consider a different XPath implementation. Does anyone 
> have any thoughts on Jaxen?

Sorry, no idea on this.

Mark

[1] https://issues.apache.org/bugzilla/show_bug.cgi?id=38197



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

Reply via email to