Message208199
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). |
|
Date |
User |
Action |
Args |
2014-01-15 22:11:04 | yselivanov | set | recipients:
+ yselivanov, gvanrossum, pitrou |
2014-01-15 22:11:04 | yselivanov | set | messageid: <1389823864.53.0.805751036513.issue20275@psf.upfronthosting.co.za> |
2014-01-15 22:11:04 | yselivanov | link | issue20275 messages |
2014-01-15 22:11:04 | yselivanov | create | |
|