commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Ivankovits <ma...@ops.co.at>
Subject Re: Strange performance issues seen with Log.isDebugEnabled()
Date Thu, 26 Jun 2008 14:42:57 GMT
Hi!

>> But the fact that you see a difference just when calling 
>> String.format is rather surprising. [...]
> The point of the custom logger was to have no cost of its own, so it 
> doesn't do any I/O of course (except when first instantiated, to prove 
> it's really in use), its logging methods are empty. The speed 
> differences were traced entirely to the String.format().
String.format() at least creates new objects (Formatter) internally, 
probably some sort of synchronization happens internally the JVM there 
too. Don't konw.

Anther guess: Try a simple "Thread.yield()" (instead of your message 
format) to see if it is a threading isse. Maybe some other thread is 
blocked due to high cpu usage of your thread!?


Ciao,
Mario


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message