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

            Bug ID: 58328
           Summary: Very slow rendering time when there are undefined el
                    variables - no caching in ImportHandler
           Product: Tomcat 8
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: regression
          Priority: P2
         Component: EL
          Assignee: dev@tomcat.apache.org
          Reporter: janusz.parfien...@gmail.com

Created attachment 33062
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=33062&action=edit
Sample page showing the problem

As it says in https://tomcat.apache.org/migration-8.html#JavaServer_Pages_2.3
static fields can be used in expressions. The problem is that every undefined
variable in such expression is checked agains configured set of packages due to
lack of caching this lookup is performed on every request. Class that performs
the lookup is the javax.el.ImportHandler
http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/javax/el/ImportHandler.java?view=markup
. It has clazzes and statics variables, their initialization suggest that they
could be used in multithreaded environment yet ImportHandler is constructed
every time new ELContext is created (and if I understand correctly this is done
in context of a single page request thus it's executed by single thread). 

I think that fields clazzes and statics should be static.

To reproduce this issue:

1. Get Tomcat, unpack and start it
2. Take attached jsp page and put it on ie to webapps/ROOT
3. Use tool like siege ( https://www.joedog.org/siege-home/ ) to test the
performance:

siege http://localhost:8080/heavyPage.jsp -c 1  -d 0 -t 10s

My results are pasted below (Tomcat7, Tomcat8, and Tomcat8 with
ImportHandler.clazzes and ImportHandler.statics changed to static). 



Apache Tomcat 7.0.64:

  Transactions:                6938 hits
  Availability:              100.00 %
  Elapsed time:                9.41 secs
  Data transferred:           16.03 MB
  Response time:                0.00 secs
  Transaction rate:          737.30 trans/sec
  Throughput:                1.70 MB/sec
  Concurrency:                0.97
  Successful transactions:        6938
  Failed transactions:               0
  Longest transaction:            0.03
  Shortest transaction:            0.00


Apache Tomcat 8.0.26:

  Transactions:                   7 hits
  Availability:              100.00 %
  Elapsed time:                9.14 secs
  Data transferred:            0.02 MB
  Response time:                1.27 secs
  Transaction rate:            0.77 trans/sec
  Throughput:                0.00 MB/sec
  Concurrency:                0.97
  Successful transactions:           7
  Failed transactions:               0
  Longest transaction:            1.36
  Shortest transaction:            1.22

Apache Tomcat - trunk version with suggested fix:

  Transactions:                5786 hits
  Availability:              100.00 %
  Elapsed time:                9.93 secs
  Data transferred:           13.36 MB
  Response time:                0.00 secs
  Transaction rate:          582.68 trans/sec
  Throughput:                1.35 MB/sec
  Concurrency:                0.97
  Successful transactions:        5786
  Failed transactions:               0
  Longest transaction:            0.02
  Shortest transaction:            0.00

Best,
  Janusz

-- 
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