Results 1 to 5 of 5

Thread: Roo tagfiles performance issues

  1. #1
    Join Date
    Jul 2005
    Posts
    156

    Default Roo tagfiles performance issues

    Hello,

    I've compared the perfomance of my webapp with and without ROO tagfiles.
    With tagfiles, my webapp to be 3 times slower.

    After this test, I created ROO's pizza sample, and modified pizza/update.jspx file to display the execution time of :
    • field:input tagfile.
    • the equivalent of field:input tag (but without tagfile).
    • a scriptlet based aquivalent to field:input tagfile.
    Cost of field:input tagfile is 12 times superior to no tag files (1735 ms vs 140 ms for 1000 iterations).
    Cost of scriptled based field:input tagfile is 6 times superior to no tag files (906 ms vs 140 ms for 1000 iterations).

    I think there's plenty of room for performance improvement in ROO tagfiles, but since scriptled usage in tagfiles is very limited (if not forbidden), I'm not sure about the best way to go.

    Should I create a JIRA to log this issue ?

  2. #2
    Join Date
    Jul 2005
    Posts
    156

    Default

    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
    Attached Files Attached Files

  3. #3
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    668

    Thumbs up

    Thanks for the detailed analysis!

    Quote Originally Posted by gonzalad View Post
    Should I create a JIRA to log this issue ?
    Yes, please log this as an improvement. If you could also post a link to the ticket here, that would be great too!
    Andrew Swan
    "Now is the EJB of our discontent made glorious Spring"

  4. #4
    Join Date
    Jul 2005
    Posts
    156

  5. #5
    Join Date
    Jul 2005
    Posts
    156

    Default

    Ok, I've found the cause of the problem.

    I've created a simple testcase (without Spring) to compare :

    So there's really a performance problem in tagfile and simpleTag performance.
    Since tagfiles are compiled to SimpleTags, the problem lies in SimpleTag handling by (at least) Tomcat.

    Tomcat doesn't pool simple tags - so perhaps the problem is there.
    I don't have a profiler here, so I cannot help anymore for the moment.

    I've tested this with Tomcat 7.0.21 and 7.0.6.

    I've uploaded the project (maven project).

    Edit : corrected simple tag performance and added Tomcat version
    Edit 2 : added more tests in sample project : folder 'generated' contains static generated JSP files (just to be sure that Tomcat has no optimization if tags have the same attributes). To regenerate those JSP files, just execute tmp.Main class in Eclipse.
    Attached Files Attached Files
    Last edited by gonzalad; Sep 7th, 2011 at 07:19 AM. Reason: added more tests

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •