On 18/04/2012 02:01, Nicolas Carranza wrote:
Federico's patch solves the performance regression (see:
http://mail.openjdk.java.net/pipermail/jdk7u-dev/2012-April/002694.html
). But instead of this patch I find better to change the PlatformLogger
class: insert "if(!isLoggable(level)) return;" at the beginning of the
method sun.util.logging.PlatformLogger.JavaLogger.doLog(int level,
String msg, Object... params) . The string convertion affecting the
performance is done on the PlatformLogger.JavaLogger.doLog (even when
the message is not loggable) and it is there where the problem should be
fixed (to be more clear and also cover more use cases). Fixing it there
also clears why the performance regression does not happen when
redirectPlatformLoggers has not been called (when logging is not used):
PlatformLogger.LoggerProxy.doLog(int level, String msg, Object...
params) does not do the string convertion when the message is not
loggable.
Federico's patch has already been pushed to the jdk8 repository, when
will it be applied to jdk7 (or my propossed change if it is preferred)?
[ Here is a jvisualvm memory profiling snapshot of
PerformanceRegresionTest3:
http://www.java.net/forum/topic/performance/general-performance-discussion/jre7s-javaawt-performance-degradation-caused-javautillogging-linux#comment-823486
. ]
Cheers,
Nicolas
I'm curious to know if you have you re-tested the performance with a
recent build of 8 or 7u4 that has the AWT fix? It would be interesting
to see then if the checking the logging level make an observable
difference or not.
-Alan