[Twisted-Python] log.callWithLogger not used - slows down reactor?

Glyph glyph at twistedmatrix.com
Wed Jun 3 01:07:37 MDT 2020



> On Jun 2, 2020, at 4:54 AM, Barry Scott <barry.scott at forcepoint.com> wrote:
> 
> I'm hunting down performance issue in our code and spotted this in
> passing. As far I can tell nothing seems to need callWithLogger.
> 
> I ran our 6k+ tests with this patch applied and everything worked.
> 
> Does anything in the twisted world need it?
> 
> Barry
> 
> diff --git a/src/twisted/internet/pollreactor.py b/src/twisted/internet/
> pollreactor.py
> index 6db1660b9..6901e5c95 100644
> --- a/src/twisted/internet/pollreactor.py
> +++ b/src/twisted/internet/pollreactor.py
> @@ -165,7 +165,7 @@ class PollReactor(posixbase.PosixReactorBase, 
> posixbase._PollLikeMixin):
>                 # Handles the infrequent case where one selectable's
>                 # handler disconnects another.
>                 continue
> -            log.callWithLogger(selectable, _drdw, selectable, fd, event)
> +            _drdw(selectable, fd, event)
> 
>     doIteration = doPoll

I think that we may have eliminated all the dependency on it.  Do your logs look any different with this change applied?  If you can demonstrate its impact on speed.twistedmatrix.com <http://speed.twistedmatrix.com/> maybe we can go ahead and do this.  The logger used to be far more dependent on this, but the "system" portion of the log message is now based more on who is doing the logging than what socket provoked the event (which is what this is tracking, effectively).

-glyph

-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20200603/35970aff/attachment-0001.htm>


More information about the Twisted-Python mailing list