[Python-Dev] Patch to telnetlib.py
Jack Diederich
jackdied at gmail.com
Sat Mar 13 19:47:58 CET 2010
On Sat, Mar 13, 2010 at 12:24 PM, gregory dudek <dudek at cim.mcgill.ca> wrote:
> The Telnet module telnetlib.py can be
> very slow -- unusably slow -- for large automated data transfers. There are typically done in raw mode.
>
> The attached patch greatly increased the speed of telnet interactions in raw mode. I submitted this a couple of year ago, but it was for an older branch of python.
>
> There are 2 key things being done:
> 1) concatenations string with string.join instead of '+' (which is probably a minor issue)
> 2) wholesale appending the raw and processed buffers when the IAC character is not found. The should be examined
> carefully since I am not an expert in the Telnet protocol, but it seems to work very well giving me a 5x speedup.
As others mentioned, please post the bug to the tracker. Also, please
assign the patch to me ("jackdied") and mention the previous bug
number - I thought I had reviewed all the telnetlib bugs including
those that were closed WONTFIX.
Thanks for the kick in the pants, I have a whole new inner loop for
data processing but I haven't applied it. I've been adding unit tests
to the module so I could be sure I wouldn't break anything but never
finished the job.
-Jack
More information about the Python-Dev
mailing list