"Patterson, Michael:" wrote:

> Kind of new to servlets...
>
> Has anyone compared the speed of various templates, JSP, etc.?
>
> When serving an .html page that will be relatively static (other than values
> being dynamically substituted into the same page locations), what would be
> the best design for speed?
>
> Other issues:
> 1)      the pages will remain [relatively] the same for a few years
> 2)      would prefer to use/write something simple like PreparedHTML

Don't know what "PreparedHTML" means.

>
> 3)      _page container_ class object will be created in servlet's init() -
> therefore page will not be loaded every time servlet is run - just once
>
> Without much knowledge about JSP...is JSP a little slower because it might
> be designed with a balance of speed, convenience, etc.?
>

Template systems may or may not precompile the static part of their pages so
that subsequent hits on the same page run faster than the first one.  Check the
docs of the particular system you are looking at to make sure.

JSP systems, in general, compile the static part of the page into an in-memory
array (if the overall length of the static text is short enough) or into one or
more disk files (if the text is quite long).  If you have enough memory, and
you arrange your JSP pages so that the length is under whatever limit your JSP
compiler sets -- perhaps by using <jsp:include> to include portions that are
common to more than one page -- then the static parts of your pages will be
rendered with zero disk I/O, which is about as fast as you can get in Java.

Calculations for the dynamic parts of your pages are likely to take a similar
amount of time in most template or JSP environments, but this varies depending
on exactly what you are doing, and what built-in support the system has for
that functionality (as well as the ratio of static to dynamic text, the overall
length of the generated pages, how fast the user's Internet connection is, the
phase of the moon :-).  The only way to know for sure is to benchmark a
representative sample of the pages of *your* application using the various
platforms.  I wouldn't listen to any advice that says "approach X is
always faster than approach Y".

>
> Thanks and take care,
>
> Michael Patterson
>

Craig McClanahan

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to