If speed is an issue in your project you may need to look
into certain optimizations that will be more applicatable for
your project. Jaroslaw Kowalski, the author of NLog, states
that log4net takes between 50-60 nanoseconds

His implementation takes 5-10 microseconds to log to a file, and
he says that NLog is faster than log4net. I can't imagine that
anything useful can happen in only 50ns ;-)

I'm not saying that logging to a file in NLog takes 50ns. I claim that non-logging (processing of a log statement which doesn't result in any log being written) in NLog is very fast (about 7 nanoseconds actually and that 140.000.000 logs per seconds without parameters and 30 nanoseconds with 3 format parameters) because of its optimised data structures and lack of some abstraction. That's all. I believe that the ability to quickly eliminate log statements at runtime is important so that you don't need to remove/comment them out.

To be honest, file logging is actually faster in log4net than in NLog because NLog by default doesn't keep the files open to allow for multiproces access and flexible file naming. This will be optimized in future versions.

Jarek
--
http://nlog.sourceforge.net/
http://blog.jkowalski.net/

Reply via email to