James Bowes wrote:
> On Tue, Mar 17, 2009 at 11:48:37PM -0400, Jesus M. Rodriguez wrote:
>> It avoids the creation of the debug string, over time this can get
>> costly. We had a huge problem
>> with this at my last job and we improved performance quite a bit by
>> simply wrapping our
>> debug logs in an if statement. the JIT pretty much compiles out the
>> block at runtime.
> 
> If you are worried about the performance aspects, you'll be delighted to
> know that the python code is full of log statements that do string
> formatting to their args before passing to the log call, and none of
> them are wrapped.
> 
> For python, at least, it would be easier and prettier to have the log
> function itself do the formatting, if the log level is high enough to
> warrant it for a given call.
> 
> I'm surprised log4j doesn't let you use sprintf style format strings and
> args, but I guess there's a log5j that does? Might be worth looking at.
> 
> -James
> 

Might be a nice thing to do after the next fork for Sat.  Having to use
log.isDebugEnabled() is ugly IMO and it'd be nice not to have to do it
where we don't have to.

> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Spacewalk-devel mailing list
> [email protected]
> https://www.redhat.com/mailman/listinfo/spacewalk-devel


-- 
Justin Sherrill, RHCA          1801 Varisty Drive.
Software Engineer                Raleigh, NC 27603
Red Hat, Inc.

_______________________________________________
Spacewalk-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to