logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorbjørn Ravn Andersen <thunderax...@gmail.com>
Subject Re: [PROPOSAL] Implementing the SLF4J API directly
Date Mon, 15 Dec 2008 09:24:22 GMT
Ceki Gulcu skrev  den 12-12-2008 16:01:
> To run this test, in addition to junit4.jar, you need to have
> slf4j-api.jar, apache-log4j-extras-1.1-SNAPSHOT.jar and log4j.jar on
> your class path.
>
> On my machine the output is:
> LogMF avg=15251
> SLF4J avg=4964
>

On my machine (which is low on RAM) I get these numbers with JDK 1.5

SLF4J avg=6085
LogMF avg=12582

I understand how you get the LogMF method to write to ytest.log, but not 
how the slf4j method does it.
Would you care to elaborate?

> This shows that an enabled logging statement runs three times faster
> when logging via SLF4J than when logging through LogMF, with log4j as
> the underlying logging framework. Not only is the SLF4J formatter
> faster, it makes a "noticeable" difference when the logs are actually
> written to destination.
This is a very substantial difference, so if the LogMF approach is to be 
used some kind of mechanism should be used to optimize - a weak 
reference cache of the MessageFormatter with the format string as key - 
but if the simpler approach is faster I would personally go with that.

-- 
  Thorbjørn Ravn Andersen  "...plus... Tubular Bells!"


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


Mime
View raw message