Announcement Announcement Module
No announcement yet.
Roo tagfiles performance issues Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Roo tagfiles performance issues


    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
    Some updates : tagfiles are CPU consumers.

    I've stripped down ROO's input.tagx tagfile to :

    <jsp:root xmlns:c="" xmlns:fn="" xmlns:spring="" xmlns:form="" xmlns:jsp="" 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"/>
    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) :
    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


    • #3
      Thanks for the detailed analysis!

      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!


      • #4
        Thanks, created :


        • #5
          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.
          Last edited by gonzalad; Sep 7th, 2011, 07:19 AM. Reason: added more tests