Article:
 |
|
Untwisting Python Network Programming
|
| Subject: |
|
performance |
| Date: |
|
2006-08-14 08:16:53 |
| From: |
|
radix
|
Response to: Why untwisting?
|
|
How were these numbers reached? Can you show us any python code or commands that you used to find them?
I notice that your synchronous version of the telnet code immediately closes the socket whereas the twisted version is waiting for the *server* to end the connection; this could definitely be affecting your times. If you add a transport.loseConnection call after your write call, the semantics should line up better, and I imagine performance will be closer to what we expect.
Also, why are you calling the private "_write" method in the telnet example?
|
Showing messages 1 through 1 of 1.
-
performance
2006-08-17 04:57:06
Kendrew
[View]
For the telnet, I measure again with the addition of transport.loseConnection() and using StatefulTelnetProtocol instead of Telnet. The Twisted telnet runs faster than before, as expected:
If you're interested, there is the Python program to measure the timing. It just invokes various usages of the two networking programs and takes the average.