Re: [Banshee-List] Logging in Banshee: use log4net?



Aaron Bockover wrote:
> I'm interested in the performance aspect of log4net. This sounds like a
> heavy component to be adding. What kind of "startup" or initialization
> does the component need? How expensive are the actual logging calls,
> etc.
> 
> --Aaron

Hello,
here are the tests I performed:
1st set, 1000 iterations, removed the 5 highest numbers
* Test1: hello world, no log4net
* Test2: include the namespace log4net
* Test3: load the log4net config file with correct config file
* Test4: try to load missing log4net config file
* Test5: load log4net config file + print debug info on the console

Each program prints "Hello World" on the console only, and exists.

These tests show the "warm up" time of log4net. Remember that the config
file is loaded once foe the entire Banshee project, there is no need for
each class or plugin to load a config file again.

Here is the line to execute each script:
for COUNT in `seq 1 1000`; do /usr/bin/time -f "%e %S %U" mono test1.exe
> /dev/null; done

and the results (addition 995 iterations):
test1 90.89	38.96	19.24
test2 306.13	124.04	132.51
test3 401.9	172.62	171.95
test4 281.06	118.66	115.85
test5 435	166.1	213.54


2nd set, 1000 iterations, removed the 5 highest numbers
* Test6: 1000 Hello World
* Test7: 1000 Hello World + Debug on console
* Test8: 1000 Hello World + Debug on file
* Test9: 1000 Hello World  + Debug on file but log Error only

Each program prints 1000 times "Hello World" on the console, and exists.
The test were done at a different time than the first set.

Test9 is similar to what would be in Banshee: Debug messages are
inserted in the code, but the configuration files specifies outputting
ERROR only in the log file. Note that optimizations could be used to
improve performance,like having a static boolean IsDebugEnabled:
if (IsDebugEnabled) log.Debug("Hello World!");

test6 75.81	34.43	14.47
test7 387.74	190.93	152.48
test8 992.69	588.12	163.52
test9 408.66	203.3	159.72

All these tests have a ratio logging/action far superior to real programs.

Any thoughts on these tests and results?
Julien



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]