commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "" <>
Subject Re: Strange performance issues seen with Log.isDebugEnabled()
Date Thu, 26 Jun 2008 07:31:22 GMT
Jean-Philippe Daigle schrieb:
> Replacing it with just this assignment (to a public var so it's not
> optimized away):
>    _dbg_str = String.format("appack>>> id=%s res=%s", id, ack_r);
> Gives me the fast throughput case. 

I wasn't too surprised to hear that your custom Log implementation was 
causing a difference when it was doing IO (writing the message out). Any 
IO operation requires a call into the operating system kernel which can 
then trigger a context switch.

But the fact that you see a difference just when calling String.format 
is rather surprising. I've had a brief look at the implementation of 
String.format and don't see any operations that would require a call to 
the kernel, or thread synchronization operations.

Nevertheless it does look like there is some thread scheduling issue 
involved here, and that something that String.format call is doing is 
affecting which threads are running and which are blocked, and that in 
turn is affecting the throughput of your application.

And of course you *are* running this on Windows.

Good luck trying to tune this; if it is indeed a thread-scheduling issue 
then you may well find that changes to OS version, JVM version, and 
apparently unrelated parts of the app cause performance to alter.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message