log4j
This are done using log4j version 1.2.9.
See also tests on Generating the caller class information.
Refer to the results in org.apache.log4j.performance.Logging for other tests
Configuration: JVM 1.4.2, Test class net.sf.jour.log4j.TestPerformance
Configuration files in folder test-scripts. Two JVM involved Client and Server.
Experimental results average duration of call to log.debug() are listed below in units of milliseconds. Accuracy 30%.
ID | System | OS | 1) Local NullAppender | 2) SocketAppender | 3) AsyncAppender |
PC0 | Intel PIII 646 MHz | XP-sp2 | 0.006 | 1.600 | 1.800 |
PC0 | Intel PIII 646 MHz | Linux FC1 | 0.020 | 1.800 | 1.430 |
PC1 | Intel PIII 500 MHz | Linux RH 8 | 0.010 | 2.400 | 1.750 |
PC2 | AMD Athlon 1.2 GHz | XP-sp2 | 0.004 | 0.800 | 1.300 |
PC1 -> PC2 100Base-TX | RH 8 -> XP-sp2 | n/a | 1.100 | 0.780 | |
PC2 -> PC1 100Base-TX | XP-sp2 -> RH 8 | n/a | 0.770 | 0.580 | |
PC3 | Intel P4 2.6 GHz Hyper-Threading | XP-sp2 | 0.005 | 0.780 | 0.810 |
PC3 | Intel P4 2.6 GHz Hyper-Threading | Linux FC2 | 0.006 | 0.490 | 0.460 |
PC4 | Intel Xeon 2CPU x 3GHz | w2k | 0.001 | 0.290 | 0.240 |
PC4 -> PC3 | w2k -> XP-sp2 | n/a | 0.200 | 0.160 |
Enable/Disable LocationInfo since it takes at least 10% when profiling application.
LoggingEvent size 540 and 470 bytes respectively.
When LocationInfo Disabled socketWrite takes 59% of CPU time.
ID | System | OS | SocketAppender | SocketAppender no LocationInfo |
PC3 | Intel P4 2.6 GHz HT | XP-sp2 | 0.800 | 0.220 |
PC3 -> PC4 | 0.360 | 0.150 |
Sending Small net.sf.jour.log4j.ProfilerEvent over the wire.
SocketAppender is LoggingEvent with no LocationInfo.
ProfilerSocketAppender is changed version of log4j SocketAppender to send only ProfilerEvent object.
LoggingEvent size 470 bytes, ProfilerEvent size 125 bytes.
ID | System | OS | SocketAppender | ProfilerSocketAppender | ProfilerArraySocketAppender | AsyncAppender | ProfilerAsyncAppender |
PC3 | Intel P4 2.6 GHz HT | XP-sp2 | 0.220 | 0.120 | 0.530 | ||
PC3 -> PC4 | 0.154 | 0.080 | 0.028 | 0.130 | 0.080 |
Using ProfilerArraySocketAppender will work much faster for ProfilerEvent.