You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Lukasz Lenart (Resolved) (JIRA)" <ji...@apache.org> on 2012/04/10 11:00:14 UTC
[jira] [Resolved] (WW-2998) Serious OGNL Performance Issues
[ https://issues.apache.org/jira/browse/WW-2998?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lukasz Lenart resolved WW-2998.
-------------------------------
Resolution: Won't Fix
Fix Version/s: (was: 2.3.x)
2.3.1
Assignee: Lukasz Lenart
This is very old issue, please upgrade to the latest available version, support for 2.0.x was dropped.
> Serious OGNL Performance Issues
> -------------------------------
>
> Key: WW-2998
> URL: https://issues.apache.org/jira/browse/WW-2998
> Project: Struts 2
> Issue Type: Improvement
> Components: Expression Language
> Affects Versions: 2.0.11
> Environment: Windows XP 5.1 (2Gb, dual-core 1.8GHz), Java 1.5.0_08, Tomcat 5.5
> Reporter: Matthew
> Assignee: Lukasz Lenart
> Fix For: 2.3.1
>
>
> I am currently running Struts 2.0.11 (planning to upgrade soon) with OGNL 2.6.11 and am having significant trouble with the appalling performance of OGNL.
> The following XML using Struts 2 Tags and OGNL takes (using the s2 profiling) 2328ms to render
> <%@ page contentType="text/xml" %><%--
> --%><%@ taglib prefix="s" uri="/struts-tags" %><%--
> --%><%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %><%--
> --%><?xml version="1.0" ?>
> <response>
> <entities>
> <s:iterator value="entities" id="entity">
> <entity <%--
> --%>id="<s:property value="id"/>" <%--
> --%>name="<s:property value="name"/>" <%--
> --%>externalId="<s:property value="externalId"/>" <%--
> --%>color="<s:property value="renderColor"/>" <%--
> --%>image="<s:property value="image.path"/>" <%--
> --%>includeInKey="<s:property value="includeInKey"/>" <%--
> --%>orderRank="<s:property value="orderRank"/>" <%--
> --%> />
> </s:iterator>
> </entities>
> </response>
> The exact same functionality, using JSTL tags and EL, takes 15ms
> <%@ page contentType="text/xml" %><%--
> --%><%@ taglib prefix="s" uri="/struts-tags" %><%--
> --%><%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %><%--
> --%><?xml version="1.0" ?>
> <response>
> <entities>
> <c:forEach items="${entities}" var="entity">
> <entity <%--
> --%>id="<c:out value="${entity.id}"/>" <%--
> --%>name="<c:out value="${entity.name}"/>" <%--
> --%>externalId="<c:out value="${entity.externalId}"/>" <%--
> --%>color="<c:out value="${entity.renderColor}"/>" <%--
> --%>image="<c:out value="${entity.image.path}"/>" <%--
> --%>includeInKey="<c:out value="${entity.includeInKey}"/>" <%--
> --%>orderRank="<c:out value="${entity.orderRank}"/>" <%--
> --%> />
> </c:forEach>
> </entities>
> </response>
> In this case the S2/OGNL is 150x (!!!!!) slower than the JSTL/EL approach. Now clearly in this case the JSTL/EL approach can be used to get decent performance, but when using S2's Freemarker based tags that option isn't available.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira