[Twisted-Python] transport.write performance.

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Tue Jul 30 03:31:39 MDT 2013


On 08:54 am, zipxing at hotmail.com wrote:
>A simple TCP echo server using epoll reactor:this server process take 
>60% cpu on 4000 request/s.
>If use self.transport.getHandle().send instead of 
>self.transport.write,it take 30% cpu on 4000 request/s.
>Why transport.write take more user cpu?Why twisted performance so poor?

`transport.write` will actually try to deliver your data.  `send` will 
as likely drop it on the floor as deliver it.  Correctness sometimes 
costs a little more CPU time.

Jean-Paul



More information about the Twisted-Python mailing list