On 25/03/2019 12:48, Mark Thomas wrote: > 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.
The profiler didn't highlight any obvious bottlenecks. There was one possibility but that turned out to be more an artefact of enabling profiling than a true bottleneck. <snip/> >> 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. I think that is actually the way to go. If you create a CoerceToResolver and place it at the start of the CompositeELResolver you should see much better performance although not quite as fast as 7.0.x A custom resolver isn't as much work as it looks. You should be able to NO-OP / return null most (all? - I'd need to check the spec) the methods apart from convertToType() which then calls ELSupport.coerceToType(null, obj, type); If anyone spots something with a profiler that I have missed and has a proposed patch to improve the EL performance I'd be happy to look at it. HTH, Mark --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org