[issue11369] Add caching for the isEnabledFor() computation

Vinay Sajip report at bugs.python.org
Wed Mar 2 10:25:16 CET 2011


Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment:

Bill,

Thanks for the suggestion and the patch. It's a good idea, though I wonder whether you found that the bulk of the time spent in isEnabledFor() was actually spent in getEffectiveLevel()? That's the one which loops through a logger's ancestors looking for a level which is actually set, so intuitively it would take a while - especially for deeper levels in the logging hierarchy. If so (which I suspect to be the case, but it would be good to have you confirm it), a better solution may be to cache the effective level.

Roughly how deep are/were your logger hierarchies in the situation where you experienced performance problems?

I'm happy to look at caching effective level for Python 3.3: The 2.X branches are now closed for additions other than bugs and security issues.

----------
assignee:  -> vinay.sajip

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11369>
_______________________________________


More information about the Python-bugs-list mailing list