On 01/21/2010 04:50 PM, Brian Stansberry wrote:
On 01/21/2010 11:20 AM, Brian Stansberry wrote:
> On 01/21/2010 10:41 AM, David M. Lloyd wrote:
>> On 01/21/2010 10:39 AM, David M. Lloyd wrote:
>>> On 01/21/2010 09:55 AM, Brian Stansberry wrote:
>
> Semi-OT: a couple weeks ago, when boot.log was< 10MB I tried setting
> -Djboss.boot.server.log.level=INFO and got very little improvement in
> boot time (< 200ms). My take on that is we must have a lot of DEBUG
> logging with very expensive message construction not guarded by
> isDebugEnabled().
John Bailey did some quick profiling or something and estimated that
during startup we have> 5000 log.debug() calls not guarded by
log.isDebugEnabled(). If you look at the debug logging output, a lot of
the messages are pretty heavy, some absolutely huge; if those aren't
guarded it's a serious cost.
[...]
I fear though that deprecating this method is a failed social
experiment. Please resist the urge to make that deprecation warning go
away by not putting a code guard around an expensive log.debug(). Either
reduce the level to trace (and keep a guard of course) or accept the
warning and bitch publicly about the deprecation.
Another alternative is to use the debugf variant instead of concatenation:
log.debugf("Something happened with %s on a %s for %s", foo, bar, baz);
This will avoid the expense of concatenation and toString when debug
logging isn't enabled (which is the most common case I think), however it
won't avoid other types of expensive computations.
- DML