Bug 50844

Summary: DateFormat.getDateTimeInstance() is very expensive, we can cache it to improve performance
Product: Log4j - Now in Jira Reporter: Xiaoming Shi <xiaoming>
Component: OtherAssignee: log4j-dev <log4j-dev>
Status: NEW ---    
Severity: normal    
Priority: P2    
Version: 1.2   
Target Milestone: ---   
Hardware: PC   
OS: All   

Description Xiaoming Shi 2011-02-28 22:11:22 UTC
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
Comment 1 Lily 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.