Anthony,

Please ignore my first reply on this thread, I misunderstood your
post, the reply I posted is irrelevant.

Here's my new reply.... :

On 4/18/07, Berglas, Anthony <[EMAIL PROTECTED]> wrote:
Hello All,

The compile time for my .jsp pages is extremely slow -- like 10 seconds
on a modern PC to the first time any page is run.  Painful during
development.

I agree that 10 seconds is too long, normally having JSP pages with a
lot of plain-text, causes them to be slow, also JSP page load time can
be attributed to non-optimized application layer code as well.

Here are a few suggestions that have worked for me:

1) If the JSP pages have a lot of plain-text, move the plain text to a
persistent store - for example an XML file or database.

2) See if there's any code in the application layer that could be
optimized --- JDBC code (normally using Connection Pooling and
Prepared Statements, batch updates/inserts).

3) If the result set returned from the persistence layer is too large
try paging it into smaller chunks.

After carefully making some of the above changes to my JSPs
(especially moving out the plain text to a persistent store), my JSP
page load within 1 second in the development environment on *first
access*.


I can compile a vast amount of Java code in 2 seconds.  It is difficult
to imagine what could be happening within Jasper to be that slow.


I thought you meant the Jasper *pre-compiler* , and not the normal
run-time compiler.

I have been using the .tag facility to define custom tags fairly
heavily.  The pages are template driven, so that my top level JSPs
contain little or no actual HTML.  But there is not that much template
code -- an XML parser should be able to read the lot in a few tens of
milliseconds.

I store all plain text in an XML file and I use XSLT to transform the
XML structure into an HTML file. Then I call the transformation from a
JSP page with JSTL's x:transform tag. This causes the page to load
very quickly.

Most of the HTML is dynamically generated by the XSLT.

Also, I store chunks of plain text with HTML formatting in an XML file
and transform it with XSLT to make the page load faster.


I suspect that there is something very specific that is causing the very
bad performance.  Have not started profiling.  I'd call this a bug.


Is the HTML being generated dynamically? or is there a lot of static
HTML and plain text?

Also, it would help to optimize the database layer and app layer code.

Any ideas most welcome.

[Pre-compiling the JSPs would not help -- it would make things worse.
At least now I only need to wait for the recompile of the JSPs that I
actually want to test in a run.  Pre-compiling would require me to wait
for all the JSPs to recompile -- many minutes.  (One needs to blast the
Jasper work area regularly otherwise changes to .tag files do not get
reflected in .jsps)]


Yeah, I agree - pre-compiling is not meant to be used during
application development anyway.

Others are of course welcome to make their suggestions :-)

-Rashmi

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to