Bug 50844 - DateFormat.getDateTimeInstance() is very expensive, we can cache it to improve performance
Summary: DateFormat.getDateTimeInstance() is very expensive, we can cache it to improv...
Status: NEW
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.2
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: log4j-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-28 22:11 UTC by Xiaoming Shi
Modified: 2011-05-05 05:52 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.

Lily
http://www.alldiscountbooks.net