New submission from Yury Selivanov: Can we remove debug timing around "self._selector.select(timeout)" (or at least make it configurable) from BaseEventLoop?
Right now the code is: # TODO: Instrumentation only in debug mode? t0 = self.time() event_list = self._selector.select(timeout) t1 = self.time() argstr = '' if timeout is None else ' {:.3f}'.format(timeout) if t1-t0 >= 1: level = logging.INFO else: level = logging.DEBUG logger.log(level, 'poll%s took %.3f seconds', argstr, t1-t0) So it makes two 'time.time()' calls per loop iteration, plus one "logging.log" call. The only non-intrusive solution that I can suggest is to add a class attribute '_debug' to BaseEventLoop, set to False by default (unittests can set it to True in their setUp methods). ---------- components: Library (Lib) messages: 208199 nosy: gvanrossum, pitrou, yselivanov priority: normal severity: normal status: open title: asyncio: remove debug code from BaseEventLoop type: performance versions: Python 3.5 _______________________________________ 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