Bug 44408 - EL-expression evaluation slow due to synchronization caused by JspFactory.getDefaultFactory
Summary: EL-expression evaluation slow due to synchronization caused by JspFactory.get...
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 6
Classification: Unclassified
Component: Jasper (show other bugs)
Version: unspecified
Hardware: All All
: P4 minor (vote)
Target Milestone: default
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-13 03:36 UTC by Robert Andersson
Modified: 2011-02-03 14:48 UTC (History)
0 users



Attachments
Patch to avoid calling synchronized method every EL evaluation (860 bytes, patch)
2008-02-13 03:39 UTC, Robert Andersson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Andersson 2008-02-13 03:36:02 UTC
Tomcat version 6.0.16 trunk (and earlier)

PageContextImpl.java has:
public static Object proprietaryEvaluate()
that does a:
final ExpressionFactory exprFactory = JspFactory.getDefaultFactory().get
JspApplicationContext(pageContext.getServletContext()).getExpressionFactory();

Our benchmarking of pages using large amounts of EL-expression shows this turns
into a bottleneck due to the fact that JspFactory.getDefaultFactory() is
synchronized.

The bug is very similar to bug #41558

I have a patch that fixes the issue, coming up...
Comment 1 Robert Andersson 2008-02-13 03:39:09 UTC
Created attachment 21515 [details]
Patch to avoid calling synchronized method every EL evaluation

The attached patch fixes the performance problem by calling the synchronized
method only once.
Comment 2 Mark Thomas 2008-04-10 10:30:09 UTC
This has been fixed in trunk and proposed for 6.0.x.
Comment 3 Mark Thomas 2008-04-16 14:46:44 UTC
This has been applied to svn for 6.0.x and will be in 6.0.17 onwards.
Comment 4 Xiaoming Shi 2011-02-03 14:48:07 UTC
Hi Robert,

I find that this similar bug can be found in other Apache projects:

./openwebbeans-1.0.0/webbeans-web/src/main/java/org/apache/webbeans/web/lifecycle/WebContainerLifecycle.java line:86
./tiles-2.2.2/src/tiles-el/src/main/java/org/apache/tiles/el/JspExpressionFactoryFactory.java line:61






(In reply to comment #0)
> Tomcat version 6.0.16 trunk (and earlier)
> 
> PageContextImpl.java has:
> public static Object proprietaryEvaluate()
> that does a:
> final ExpressionFactory exprFactory = JspFactory.getDefaultFactory().get
> JspApplicationContext(pageContext.getServletContext()).getExpressionFactory();
> 
> Our benchmarking of pages using large amounts of EL-expression shows this turns
> into a bottleneck due to the fact that JspFactory.getDefaultFactory() is
> synchronized.
> 
> The bug is very similar to bug #41558
> 
> I have a patch that fixes the issue, coming up...