Are there concrete metrics which suggest that isXEnabled() is horribly slow? If so, then it sounds like we should write a simple utility to perform lazy caching of this information... but I was under the impression that the isXEnabled() methods were not so slow, but I have not profiled them.

Do we need to worry about this now?

What doe the Log4j folks have to say about this?

--jason


On Wednesday, August 13, 2003, at 10:26 PM, Jeremy Boynes wrote:

From: Jason Dillon [mailto:[EMAIL PROTECTED]

I would depend on how it was cached.  If you mean if a method
traces or
debugs more than once, it should definitely create a local
variable to
cache if the level is enabled, but if you mean for a larger scoped
cache, this could make it hard to debug a running server, as you can
always tweak the active levels at runtime.

Local variable, a given.

The thing is, the isXEnabled() method gets called a gazillion times to
detect the one time that the level was bumped up, which happends very
infrequently. I'm assuming this goes through a synchronized block as
well, add yet more ns to the call. The runtime feature is useful but has
a price.


Some form of lazy caching scheme may be appropriate, provided checking
invalidation is quicker than the call to isXEnabled().

--
Jeremy




Reply via email to