[EMAIL PROTECTED]
Sent: Friday, April 23, 2004 10:38 AM
To: Log4J Users List
Subject: Re: Which Way of "Extending" Gives Fastest Performance
On Fri, 23 Apr 2004, Denis Haskin wrote:
| This conversation seems to have focused more on the checking of the
| boolean, which wasn't my origina
On Fri, 23 Apr 2004, Denis Haskin wrote:
| This conversation seems to have focused more on the checking of the
| boolean, which wasn't my original point.
|
| The issue I was raising was just to be aware of the potential cost of
| assembling the parameters for the debug() call, particularly because
This conversation seems to have focused more on the checking of the
boolean, which wasn't my original point.
The issue I was raising was just to be aware of the potential cost of
assembling the parameters for the debug() call, particularly because you
will bear that cost even if debug logging i
On Thu, 22 Apr 2004, Robert Pepersack wrote:
| I've never tried calling isDebugEnabled() again and again in the same
| class. I'm new to log4j, so I don't have a lot of code that uses
| log4j. It doesn't cost me anything to factor out the tests from the
| beginning. Every little bit of performa
On Thu, 22 Apr 2004, Robert Pepersack wrote:
| It shouldn't be significant. On page 41 of the book, Ceki says, "This is
| an insignificant overhead because evaluating a logger takes less than 1% of
| the time it actually takes to log. If a method contains multiple log
| statements, it may be pos
On Thu, 22 Apr 2004, Robert Pepersack wrote:
| You could create a class boolean variable that is set once by
| isDebugEnabled(). Then you could say:
|
| private boolean debug = logger.isDebugEnabled();
|
| In you method code you could say:
|
| if (debug) cat.debug(myObject.showState());
|
| This
ase performance may actually decrease performance).
James Stauffer
-Original Message-
From: Robert Pepersack [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 22, 2004 1:24 PM
To: Log4J Users List
Subject: RE: Which Way of "Extending" Gives Fastest Performance
I've neve
ble affect on your performance than
is that just wasted time?
James Stauffer
-Original Message-
From: Robert Pepersack [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 22, 2004 12:21 PM
To: Log4J Users List
Subject: RE: Which Way of "Extending" Gives Fastest Performance
It shou
persack [mailto:[EMAIL PROTECTED]
>Sent: Thursday, April 22, 2004 11:49 AM
>To: Log4J Users List
>Subject: Re: Which Way of "Extending" Gives Fastest Performance
>
>
>You could create a class boolean variable that is set once by
>isDebugEnabled(). Then you could say:
>
To: Log4J Users List
Subject: Re: Which Way of "Extending" Gives Fastest Performance
You could create a class boolean variable that is set once by
isDebugEnabled(). Then you could say:
private boolean debug = logger.isDebugEnabled();
In you method code you could say:
if (debug) cat.debu
Is the call to isDebugEnabled actually significant?
James Stauffer
-Original Message-
From: Robert Pepersack [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 22, 2004 11:49 AM
To: Log4J Users List
Subject: Re: Which Way of "Extending" Gives Fastest Performance
You coul
You could create a class boolean variable that is set once by
isDebugEnabled(). Then you could say:
private boolean debug = logger.isDebugEnabled();
In you method code you could say:
if (debug) cat.debug(myObject.showState());
This would make it so that you only call isDebugEnabled() once in
This is a little off from the original question, and note that we also
haven't touched any of our logging code in quite a while, but:
We found that we had to address some performance problems where there
was an insignificant cost to creating the string that we were going to
send to log4j.
For
>> I believe Ceki's assertion that wrapping is the best and
safest thing to do from a software engineering standpoint. But, my users
and my boss care more about how fast the application performs. <<
Do no logging at all. That will be fastest. Of course, it may not be right, but you've
just sai
Do you know that logging has a significant effect on your current
performance? If it only takes 0.01% of CPU time then it doesn't really
matter.
James Stauffer
-Original Message-
From: Robert Pepersack [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 22, 2004 10:31 AM
To: [EMAIL PROTEC
15 matches
Mail list logo