STINNER Victor added the comment:

Here are two patches:

- logger_is_enabled_for.patch: use logger.isEnabledFor(INFO) to avoid the call
- add a _debug flag to BaseEventLoop

Benchmark:

- original: 3.90
- logger: 3.04
- _debug: 2.81

I like the _debug flag because it's faster, but I'm not sure that an attribute 
is the best place for the flag. asyncio needs maybe one global debug flag (ex: 
asyncio._DEBUG=True) replacing the existing asyncio.tasks._DEBUG flag.

----------
Added file: http://bugs.python.org/file33486/logger_is_enabled_for.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20275>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to