On 25/03/2019 08:40, Thibault Kruse wrote:
> On Wed, Mar 20, 2019 at 7:04 PM Mark Thomas <ma...@apache.org> wrote:
>>
>> On 20/03/2019 05:13, Thibault Kruse wrote:
>>> Hi,
>>>
>>> when migrating from Tomcat7 to Tomcat8 for an application using javax-el
>>> expression evaluation on every request, we noticed a significant
>>> performance impact.
>>
>> Try the latest 8.5.x implementation.
> 
> It is the same issue with
> * org.apache.tomcat:tomcat-jasper-el:8.5.38
> * org.apache.tomcat:tomcat-jasper-el:8.5.39
> * org.apache.tomcat:tomcat-jasper-el:9.0.14.1
> 
>> If you still see an issue, a simple test case that reproduces the issue
>> would be appreciated.
> 
> This example project demonstrates the issue with a naive benchmark (I
> know JMH would be better):
> https://github.com/tkruse/javax-getvalue-slowdown

Thanks. That helps clarify the situation.

I can see the difference (a factor of between 3 and 4) running that code
with Tomcat 7.0.x and 9.0.x. I'll have a look with a profiler.

I will note at this point that the work-around commented out in that
test case is not specification compliant. For example, null coerced to
String should result in "".

Mark


> 
> In
> https://github.com/tkruse/javax-getvalue-slowdown/blob/dd4fbab443c31ccf4f791bb8b873cfcb3ebefc1b/src/test/java/javax/el/demo/BenchmarkEl.java#L73
> it is possible to bypass the unnecessary code (unnecessary for our
> use-case and likely many other use-cases), and reduce the slowdown
> somewhat. We can also try adding a custom ELResolver to the
> CompositeELResolver which handles the simple coercion cases, though
> that seems a bit more complex since class ELResolver has a lot of
> methods to implement.
> 
> But ideally we want to keep having apache-el:7 performance, and we
> currently consider shading apache-el:7 to run our code on Tomcat8 with
> shaded apache-el:7 as additional library on the classpath. If there
> was a better way to avoid the performance hit (without using all
> JavaEE7 language features), that would be useful to know.
> 
> 
>> Finally, note that org.mortbay.jasper:apache-el:8.0.33 is not something
>> that has been released by the Tomcat project.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 


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

Reply via email to