https://bz.apache.org/bugzilla/show_bug.cgi?id=59699

            Bug ID: 59699
           Summary: Caching issue in ELContext / ImportHandler
           Product: Tomcat 8
           Version: 8.5.x-trunk
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: EL
          Assignee: dev@tomcat.apache.org
          Reporter: benjamin.da...@gmail.com

Hi,

We have just migrated from Glassfish 3 to Jetty 9.3.8 which uses Tomcat
javax.el implementation. Just after the migration, we saw huge performance
drops.

After some investigation (thread dumps,...), most of the code was busy loading
classes through javax.el.ImportHandler class.

This class seems to have been designed to be thread-afe (use of
ConcurrentHashMap), but gets instanciated for every expression being evaluated.
This is beacuse javax.el.ELContext class creates new instances of
javax.el.ImportHandler every time it gets instanciated.

Most the EL expressions "stuck" in this class loading phase were looking for
empty attributes.

I applied a quick fix, and the performances went back to normal (time divided
by 2).

I think the javax.el.ImportHandler class ought to be used as a singleton. I
understand the problems with caching all classes, but by caching only the
ClassNotFound, the problem also goes away.

I am happy to provide some help (and code), if you think this fix is a good
idea.

Thanks,
Benjamin

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

Reply via email to