Some updates : tagfiles are CPU consumers.
I've stripped down ROO's input.tagx tagfile to :
Code:
<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:spring="http://www.springframework.org/tags" xmlns:form="http://www.springframework.org/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0">
<jsp:output omit-xml-declaration="yes" />
<jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)" />
<jsp:directive.attribute name="field" type="java.lang.String" required="true" rtexprvalue="true" description="The field exposed from the form backing object" />
<jsp:directive.attribute name="label" type="java.lang.String" required="true" rtexprvalue="true" description="The label used for this field, will default to a message bundle if not supplied" />
<jsp:directive.attribute name="cssClass" type="java.lang.String" required="false" rtexprvalue="true" description="The CSS class" />
<jsp:directive.attribute name="disabled" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Specify if this field should be enabled" />
<div id="_${id}_id">
<label for="_${field}_id"><c:out value="${label}" />:</label>
<form:input id="_${field}_id" path="${field}" disabled="${disabled?'true':'false'}" cssClass="${cssClass}"/>
<form:errors cssClass="errors" id="_${field}_error_id" path="${field}" delimiter="label"/>
</div>
</jsp:root>
Performance comparison with ROO original input.tagx tagfile :
- ROO original tag : 12*.
- this stripped down version : 4*.
Tests where made with :
- Tomcat 7.0.21
- Tomcat 7.0.6
- Tomcat 6.0.29
Only difference I see between tagfile and notagfile is that tagfiles instances are not pooled by tomcat.
P.S. I've attached the testcase.
- update.jspx is pizza/update.jspx file.
- input.tagx is ROO original tagfile.
- input4.tagx is the stripped down tagfile.
- tomcat-compiled-files folder contains the java source code for compiled JSPs.
Sample output is (at the end of the JSP file) :
Code:
ROO tag file {count=1000, elapsed=1718}
Scriplet tag file {count=1000, elapsed=906}
Simplified tagfile v3 {count=1000, elapsed=999}
Simplified tagfile v4 {count=1000, elapsed=672}
No tagfile {count=1000, elapsed=156}
Roo tagfile = 11 * no tag file
Scriplet tagfile = 5 * no tag file
Simplified tagfile v3 = 6 * no tag file
Simplified tagfile v4 = 4 * no tag file