[Twisted-Python] Re: GUI responsiveness

Antoine Pitrou solipsis at pitrou.net
Fri Sep 16 06:25:21 EDT 2005

> class PyuiClient( NetworkClient ):
>     def __init__( self  ):
>         # ...
>         self._pyuiRefresh( .001 )
>     def _pyuiRefresh( self, delay ):
>         pyui.draw()
>         pyui.update()
>         reactor.callLater( delay, self._pyuiRefresh, delay )

This looks like a busy wait loop. It will eat a good chunk of the CPU
time (depending on the time taken by each "_pyuiRefresh" iteration) and
your laptop users (if there any) may not be very happy... It may slow
down other apps tooo.

More information about the Twisted-Python mailing list