Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.0.11
    • Fix Version/s: 2.3.1
    • Component/s: Expression Language
    • Labels:
      None
    • Environment:

      Windows XP 5.1 (2Gb, dual-core 1.8GHz), Java 1.5.0_08, Tomcat 5.5

    • Flags:
      Important

      Description

      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.

        Activity

        Hide
        Lukasz Lenart added a comment -

        This is very old issue, please upgrade to the latest available version, support for 2.0.x was dropped.

        Show
        Lukasz Lenart added a comment - This is very old issue, please upgrade to the latest available version, support for 2.0.x was dropped.
        Hide
        Lukasz Lenart added a comment -

        Could you try to use the latest version ? There was a lot of improvements regarding OGNL

        Show
        Lukasz Lenart added a comment - Could you try to use the latest version ? There was a lot of improvements regarding OGNL
        Hide
        Matthew Seaborn added a comment -

        Following the submission of this issue it occured to me that the class loading structure of the Tomcat server in which this issue is being experienced is odd.

        All of the JARs can be found in the /jre/lib/ext directory and are referenced using the common.loader in catalina.properties.

        Show
        Matthew Seaborn added a comment - Following the submission of this issue it occured to me that the class loading structure of the Tomcat server in which this issue is being experienced is odd. All of the JARs can be found in the /jre/lib/ext directory and are referenced using the common.loader in catalina.properties.

          People

          • Assignee:
            Lukasz Lenart
            Reporter:
            Matthew
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development