I would expect that, FreeMarker templates(+ struts code) will always
be slower than java code. If you are using the simple tags, give a try
to the Java Tags:

http://cwiki.apache.org/S2PLUGINS/java-templates-plugin.html

musachy

On Thu, Jan 14, 2010 at 4:48 PM, Mark Greene <green...@gmail.com> wrote:
> I've been evaluating struts 2.1.8.1 and have found some troubling
> performance bottlenecks relating to the struts tag and freemarker. I have a
> JSP that has 7 struts2 tags in it. (A simple signup form)
>
> I noticed in my load testing that the throughput of this page was 4-5 times
> slower under load (100 concurrent threads) than a JSP page with no struts2
> tags on it. I cracked open my profiler and noticed the majority of the time
> spent in a page request was within freemarker. I uploaded a screen shot from
> my profiler here : http://tinypic.com/r/20johet/6 . I've seen a lot of
> discussion on the mailing lists about performance related issues and the
> recommendations that came along with them to address it. I believe I've done
> everything I can to tune this simple page. I would appreciate any feedback
> if there is something I am missing. Or is this a known issue?
>
> struts.xml:
> <struts>
> <!-- Constants -->
> <constant name="struts.devMode" value="false" />
>  <constant name="struts.i18n.encoding" value="UTF-8" />
>  <constant name="struts.multipart.maxSize" value="2000000" />
> <constant name="struts.ui.theme" value="css_xhtml" />
>  <constant name="struts.freemarker.templatesCache" value="true" />
> <constant name="struts.ui.templateDir" value="template"/>
>  <constant name="struts.enable.SlashesInActionNames" value="true" />
> <constant name="struts.convention.action.disableScanning" value="true" />
>  <constant name="struts.enable.DynamicMethodInvocation" value="false" />
> <constant name="struts.url.includeParams" value="all" />
>
> <!-- Configuration for the default package. -->
> <package name="default" extends="struts-default">
>  <result-types>
> <result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult"
> />
>  </result-types>
>
> <interceptors>
> <!-- Copied from struts-default.xml and changed validation exclude methods
> -->
>  <interceptor-stack name="defaultStack">
> <interceptor-ref name="exception" />
>  <interceptor-ref name="alias" />
> <interceptor-ref name="servletConfig" />
>  <interceptor-ref name="prepare" />
> <interceptor-ref name="chain" />
>  <interceptor-ref name="debugging" />
> <interceptor-ref name="profiling" />
>  <interceptor-ref name="scopedModelDriven" />
> <interceptor-ref name="modelDriven" />
>  <interceptor-ref name="fileUpload" />
> <interceptor-ref name="checkbox" />
>  <interceptor-ref name="staticParams" />
> <interceptor-ref name="params">
>  <param name="excludeParams">dojo\..*</param>
> </interceptor-ref>
>  <interceptor-ref name="conversionError" />
> <interceptor-ref name="validation">
>  <param name="excludeMethods">cancel,delete,list</param>
> </interceptor-ref>
>  <interceptor-ref name="workflow">
> <param name="excludeMethods">input,back,cancel,browse</param>
>  </interceptor-ref>
> </interceptor-stack>
> <interceptor-stack name="fileUploadStack">
>  <interceptor-ref name="fileUpload" />
> <interceptor-ref name="defaultStack" />
>  </interceptor-stack>
> </interceptors>
> <action name="new" class="testapp.CreateAccount" method="show">
>  <result name="input" type="tiles">account.create</result>
> </action>
>  </package>
> </struts>
>
>
>
> JSP Page (snippet):
>  <s:form action="create" >
> <fieldset>
>  <p><label>Name</label>
> <s:textfield name="user.name" cssClass="txt-input small" />
>
> <p><label>Email</label>
> <s:textfield name="user.email" cssClass="txt-input small" />
>
> <p><label>Site Address</label>
> <s:textfield name="account.subDomain" cssClass="txt-input small" />
>
> <p><label>Password</label>
>
>
> <s:password name="user.password" cssClass="txt-input small"  />
>
> <p><label>Confirm Password</label>
> <s:password name="user.passwordConfirm" cssClass="txt-input small" />
>  </fieldset>
>
> <s:submit cssClass="button"/>
> </s:form>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to