tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kin-Man Chung <Kin-Man.Ch...@Eng.Sun.COM>
Subject Re: [PATCH] possible speed enhancement to JspServlet.java
Date Fri, 19 Apr 2002 23:58:54 GMT
Thank you for the patch!  It looks interesting!  I'll definitely look
at it carefully and apply it to jasper or jasper2 when I have time,
most probably sometime next week.

> Date: Fri, 19 Apr 2002 17:09:49 -0400
> From: Duncan McLean <duncan.mclean@kingston.hummingbird.com>
> Subject: [PATCH] possible speed enhancement to JspServlet.java
> To: Tomcat Developers List <tomcat-dev@jakarta.apache.org>
> MIME-version: 1.0
> Content-transfer-encoding: 7bit
> X-Accept-Language: en,pdf
> Delivered-to: mailing list tomcat-dev@jakarta.apache.org
> Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm
> User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:0.9.4.1) 
Gecko/20020314 Netscape6/6.2.2
> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
> List-Post: <mailto:tomcat-dev@jakarta.apache.org>
> List-Subscribe: <mailto:tomcat-dev-subscribe@jakarta.apache.org>
> List-Unsubscribe: <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
> List-Help: <mailto:tomcat-dev-help@jakarta.apache.org>
> List-Id: "Tomcat Developers List" <tomcat-dev.jakarta.apache.org>
> 
> 	I'm new to this list (and the jasper code), so please let me know if 
I've
> submitted this incorrectly.
> 	I was doing some profiling of the server side environment that I work on
> and noticed that quite a bit of time was being used in the JSP engine. After
> further investigation I noticed that each JSP request that comes into the 
jasper
> engine generates a new compiler object and attempt at compilation. As much as 
15%
> of the time of a JSP request is wasted this way.
> 	The change I made attempts to read the last modified date from the JSP
> file being request. A comparison is made against known last modified time
> for the current compiled version, if they are different then the code flows
> as it used to. If the times are the same then the rest of loadJSP is skipped.
> 	In my test application which relies on calling ~10 jsp files to generate
> a single page I found a speed improvement of ~25-50ms (on a PIII 650).
> 	There may be better ways to do this. I concentrated my fix here because
> it is where the profiler said the problem was. One drawback of the code I'm
> submitting is that if there are a large number of JSP's the Hashtable I use to
> store information may get large. However I can't see that being a problem 
until
> a site has >10,000 jsp's.
> 	The change I'm submitting may not be the correct way to approach the
> problem. Either way I think this is an issue that deserves some attention so
> if someone can suggest a better fix please do.


--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message