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

Attachment: pgpbHxMvsBXuk.pgp
Description: PGP signature

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to