You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Curt Arnold <ca...@apache.org> on 2006/01/17 22:57:36 UTC

Re: Experimental log4j formatter in sandbox

The recent changes (r 369909 and 369913) added optimization for  
single argument format requests that satisfy the threshold  
requirements.  If the pattern contains quotes or substitution tokens  
other than "{0}", the request will be delegated to  
java.util.MessageFormat, otherwise it will be handled within LogMF  
and the logging cost is very close to that of passing a literal string.

The approach could be extended to the multiple argument methods, but  
I will have to investigate further to see if the performance benefit  
is justified as the difference in performance was most pronounced  
with single argument methods.

Other changes in the commit:

Eliminated Java 5 constructs in LogMF and LogSF.
Changed the packaging to produce log4j-logmf-0.1.jar, log4j- 
logsf-0.1.jar and log4j-logf-0.1.jar
Eliminated the 0 substitution parameter methods like LogMF.debug 
(Logger logger, String pattern)
Added  4 substitution parameter methods.

The addition of the 4 substitution parameter methods will mean that  
you will only miss the Object... methods (which were changed to Object 
[] while removing Java 5 features) when you have 5 or more  
substitution parameters which hopefully means that you will not miss  
the Object... methods at all.

The API of LogSF was synchronized with the changes in LogMF, but it  
currently has an unnecessary array creation for single argument methods.

No changes to LogF in this iteration.  However, it would benefit even  
more from the optimization approach added to LogMF.

Potential enhancements:

Adding LogMF.debug(ResourceBundle bundle, String key, ...) methods.
Adding LogF optimizations for simple patterns, for example: "Hello, %s"





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