You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2011/03/01 04:11:24 UTC

DO NOT REPLY [Bug 50844] New: DateFormat.getDateTimeInstance() is very expensive, we can cache it to improve performance

https://issues.apache.org/bugzilla/show_bug.cgi?id=50844

           Summary: DateFormat.getDateTimeInstance() is very expensive, we
                    can cache it to improve performance
           Product: Log4j
           Version: 1.2
          Platform: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Other
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: xiaoming@cs.wisc.edu


In the file :
./src/main/java/org/apache/log4j/lf5/util/DateFormatManager.java line:229

We can cache the result by adding a static class member field. 

This is the same as the Bug 48778

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 50844] DateFormat.getDateTimeInstance() is very expensive, we can cache it to improve performance

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50844

--- Comment #1 from Lily <li...@gmail.com> 2011-05-05 05:52:13 UTC ---
We faced the similar problem for performance of log4j. Basically we log a bunch
of messages for each http request. Then, we found that http response time gets
hits. So what we ended up was to first log each message to a StringBuffer,
after some messages are logged, i.e. 100, we then call log4j api to log. This
has improved the response time. However, we still see a response hit when the
chunk of messages
are written to file.

Lily
http://www.alldiscountbooks.net

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org