You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Jim Kennedy <ji...@gigaheads.com> on 2003/12/05 20:39:19 UTC

Seeing poor JSTL performance

I've been reading some developers comments that the JSTL does not perform very well.  I'm am experiencing poor performance that I attribute to the use of the JSTL.  Here is something typical I do:



------------------------------------------------------
<form method="post" action="leased/search">
    <input type="hidden" name="<c:out value='${CONTRACT_NUM}' />" value="<c:out value='${contract.id}' />" >


    Description: <input type="text" name="<c:out value='${DES}' />" value="<c:out value="${search['des_key']}" />" size="20" class="textbox">&nbsp;

    Model Number: <input type="text" name="<c:out value='${MN}' />" value="<c:out value="${search['mn_key']}" />" size="20" class="textbox"><BR>

Serial Number: <input type="text" name="<c:out value='${SN}' />" value="<c:out value="${search['sn_key']}" />" size="20" class="textbox">&nbsp;

PO Number: <input type="text" name="<c:out value='${PO}' />" value="<c:out value="${search['po_key']}" />" size="30" class="textbox"><br>

    Location: <select name="<c:out value='${LOC}' />" class="selectarea">
        <OPTION value="">Select a location</OPTION>
        <c:forEach items="${company_locations}" var="location" >
            <option value="<c:out value='${location.id}'/>" <c:if test="${location.id==search['asset_locationcode']}" >SELECTED</c:if> >
            <c:set var="address" value="${location.street1}" />
            <c:out value="${address}, ${location.city} ${location.state}" />
        </option>
        </c:forEach>
</select>&nbsp;

<input type="submit" name="search" value="Search" class="bluebutton">
<input type="submit" name="clear" value="Clear Search" class="bluebutton">
</form>
---------------------------------------------------------------

Is there something I'm doing in the code that I could avoid to enhance the performance.  This is only a code fragment. Assume that variables are defined in advance.

Re: Seeing poor JSTL performance

Posted by Peter Lin <tc...@yahoo.com>.
 
if you do a search on taglibs-user for 2002, you'll lots of benchmarks I ran using JSTL. The long and short of it is this.
 
1. JSP tags use quite a bit more memory than scriptlet (i.e. pure java embedded in jsp). Many people consider scriptlet evil.
 
2. if you're using more than 150 tags per page, you should consider turning on tag pooling if you're using tomcat. If you're not using tomcat, see if your webserver supports tag pooling.
 
3. are your beans efficient. things like doing search may be cpu/time intensive.
 
4. what is the expected concurrent load?
 
 
tomcat5 just went stable and it supports page level tag pooling. If you can, run OptimizeIt on your pages to see exactly why it's not performing well. JSTL may not be the cause, but you won't know until you get real data.
 
peter


Jim Kennedy <ji...@gigaheads.com> wrote:
I've been reading some developers comments that the JSTL does not perform very well. I'm am experiencing poor performance that I attribute to the use of the JSTL. Here is something typical I do:



------------------------------------------------------

 [input] " name="">


Description:  [input] " ${search[?des_key?]}?>" size="20" class="textbox"> 

Model Number:  [input] " ${search[?mn_key?]}?>" size="20" class="textbox">


Serial Number:  [input] " ${search[?sn_key?]}?>" size="20" class="textbox"> 

PO Number:  [input] " ${search[?po_key?]}?>" size="30" class="textbox">


Location: "> Select a location " test="${location.id==search['asset_locationcode']}" SELECTED > 

 [input] 
 [input] 

---------------------------------------------------------------

Is there something I'm doing in the code that I could avoid to enhance the performance. This is only a code fragment. Assume that variables are defined in advance.


---------------------------------
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard