On Jan 22, 2005, at 12:41 PM, Ceki G�lc� wrote:
Do you have numbers comparing

org.apache.log4j.WriterAppender wa = new org.apache.log4j.WriterAppender();
wa.setWriter(w);
new PerformanceTest(wa);


with

org.apache.log4j.concurrent.WriterAppender wa2 = new org.apache.log4j.concurrent.WriterAppender();
wa2.setWriter(w);
new PerformanceTest(wa2);



Since the existing Layouts recycle the string buffer, in the single threaded case, I would expect the existing code to outperform your version which creates a new CharArrayWriter with each conversion. You seem to indicate that the performances are more or less on par.



I'm a little occupied with other things right now to contribute at the moment, but thought I would throw a couple things out. I had hoped to fabricate a reasonable multithreaded performance test for use in addressing the sequenceCount issue. It seems that such a performance test would be useful, if not essential, to evaluate these changes.


Layout.format(LoggingEvent) is not thread-safe due to the use of the charArrayWriter member variable. However, that method is appears to be a convenience wrapper for Layout.format(Writer, LoggingEvent) which should be thread-safe. Layout.format(LoggingEvent) doesn't appear to be used in a huge number of places and may be beneficial to remove Layout.format(LoggingEvent) since the caller (typically an appender) might be able to maintain its own CharArrayWriter with out introducing additional synchronization issues.


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to