This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author yselivanov
Recipients gvanrossum, pitrou, yselivanov
Date 2014-01-15.22:11:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1389823864.53.0.805751036513.issue20275@psf.upfronthosting.co.za>
In-reply-to
Content
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).
History
Date User Action Args
2014-01-15 22:11:04yselivanovsetrecipients: + yselivanov, gvanrossum, pitrou
2014-01-15 22:11:04yselivanovsetmessageid: <1389823864.53.0.805751036513.issue20275@psf.upfronthosting.co.za>
2014-01-15 22:11:04yselivanovlinkissue20275 messages
2014-01-15 22:11:04yselivanovcreate