[ 
https://issues.apache.org/jira/browse/LOG4J2-151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13558555#comment-13558555
 ] 

Remko Popma commented on LOG4J2-151:
------------------------------------

Ralph,

The performance test results in the readme.txt in the attachment were done on 
my Windows laptop at home.
I also ran the same tests on an enterprise server. Here are the results for 
comparison:

Results of the performance tests, measured on Solaris-10 64 bit, JDK 1.7.0_06,
8 cores Xeon X5570 CPU @ 2.93 GHz with hyperthreading switched on

Same test as before:
The measured time is the average time per log event, when logging 100,000 events
with a 500-byte message and one MDC key-value pair.

SL = Standard (synchronous) Logger
AL = Async Logger
SA = Standard File Appender with BufferedIO=true
FA = Fast File Appender
IF = Immediate Flush=true

SL + SA: 5067 nanos (average of 5311, 5511, 4928, 4792, 4794)
SL + FA: 3990 nanos (average of 4089, 4117, 4015, 4058, 3671)
AL + SA:  156 nanos (average of 152, 154, 157, 151, 166)
AL + FA:  150 nanos (average of 152, 152, 151, 146, 152)

SL + SA + IF: 8290 nanos (average of 8475, 8525, 8606, 7756, 7992)
SL + FA + IF: 8112 nanos (average of 7741, 8596, 7760, 7918, 8549)
AL + SA + IF:  158 nanos (average of 170, 160, 152, 153, 155)
AL + FA + IF:  156 nanos (average of 165, 162, 153, 154, 149)

Observations:
* some interesting differences between Windows and Solaris, especially for 
immediateFlush=true
* in most cases, RandomAccessFile is quite a bit faster than 
BufferedOutputStream 
* If users need their log events flushed to disk, then AsyncLogger + 
FastFileAppender can give a 40x to 55x performance improvement

                
> Please facilitate subclassing Logger and LoggerContext (in 
> org.apache.logging.log4j.core)
> -----------------------------------------------------------------------------------------
>
>                 Key: LOG4J2-151
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-151
>             Project: Log4j 2
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 2.0-beta3
>            Reporter: Remko Popma
>         Attachments: FastLog4j.zip
>
>
> I would like to create a custom logger, while reusing the 
> org.apache.logging.log4j.core.Logger functionality.
> The following two changes would make subclassing possible:
> * change visibility of method Logger$PrivateConfig#logEvent(LogEvent) (line 
> 265) from protected to public
> * change visibility of method LoggerContext#newInstance(LoggerContext, 
> String) (line 310) from private to protected
> My use case is that I want to create an asynchronous Logger for low latency 
> logging.
> This custom logger hands off control to a separate thread as early as 
> possible. In my case, AsynchAppender is not a good match for my requirements, 
> as with that approach (a) the logging call still needs to flow down the 
> hierarchy to the appender, doing synchronization and creating objects at 
> various points on the way, and (b) when serializing the LogEvent, the 
> getSource() method is always called, which is expensive.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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

Reply via email to