Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-4201

DateFormat.getDateTimeInstance() is very expensive, we can cache it to improve performance

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Implemented
    • Release Branch 10.04
    • None
    • framework
    • None
    • Bug Crush Event - 21/2/2015

    Description

      In the files:

      ./apache-ofbiz-10.04/framework/base/src/org/ofbiz/base/util/UtilDateTime.java line:702
      ./apache-ofbiz-10.04/framework/base/src/org/ofbiz/base/util/UtilFormatOut.java line:314
      ./apache-ofbiz-10.04/framework/webapp/src/org/ofbiz/webapp/taglib/FormatTag.java line: 78

      DateFormat.getDateTimeInstance() is called for every function call of "toGmtTimestampString" or "formatDate". We can cache the value by adding a static class field and improve performance.

      This is similar to the Apache Bug https://issues.apache.org/bugzilla/show_bug.cgi?id=48778

      Attachments

        Activity

          People

            jleroux Jacques Le Roux
            nancyesmis Xiaoming Shi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: