Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-3949

FreeMarker Template in struts2.3.7 is significantly slower than 2.3.4.1 and earlier

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.7
    • 2.3.8
    • Core Actions
    • None
    • JDK 1.6, tomcat 6.0.24, struts 2.3.7

    Description

      A page using numerous <s:... tags using freemarker, take considerably longer in struts 2.3.7.
      A page with at least 50 <s:textfield.../> takes over 14 seconds to load in struts 2.3.7 where in struts 2.3.4.1 and earlier it takes 2-4 seconds.

      The following settings are in my struts.properties file:
      struts.freemarker.templatesCache=true
      struts.freemarker.templatesCache.updateDelay=600000
      struts.freemarker.mru.max.strong.size=0

      I turned on logging and believe the issue is partly in the retrieval of the cached copy.

      In struts 2.3.4.1 - the logging between the last lookup of the previous field and the retrieval of the text.ftl cache is 16ms
      [2012-12-17/11:59:23.309/EST] DEBUG [freemarker.beans] line 81: Key "labelposition" was not found on instance of java.util.LinkedHashMap. ...
      [2012-12-17/11:59:23.325/EST] DEBUG [freemarker.cache] line 81: "/resources/template/custom-css/text.ftl"["false",ISO-8859-1,parsed] cached copy not yet stale; using cached.

      In struts 2.3.7 - the logging between the last lookup of the previous field and the retrieval of the text.ftl cache is 187ms
      [2012-12-17/12:01:56.312/EST] DEBUG [freemarker.beans] line 81: Key "labelposition" was not found on instance of java.util.LinkedHashMap. ...
      [2012-12-17/12:01:56.499/EST] DEBUG [freemarker.cache] line 81: "/resources/template/custom-css/text.ftl"["false",ISO-8859-1,parsed] cached copy not yet stale; using cached.

      So the difference between these to environments is over 10 times to do the same thing. This difference is consistent throughout the log file.

      I played with different settings in the properties file without any success and the log is telling me that the cache is being used.

      I can provide complete log files if required.

      Attachments

        Activity

          People

            Unassigned Unassigned
            stroxell Scott Troxell
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: