Subject: | Slow performance when pulling back large data |
Net::Telnet 3.0.3
This is perl, v5.6.1 built for sun4-solaris
SunOS XXXXX.fordys.net 5.8 Generic_108528-20 sun4u sparc SUNW,Ultra-4
If you try pulling back large amounts of data over a telnet session, it can take a long time, and hog a lot of CPU time to pull the data back. I believe this is due to the entire buffer downloaded so far being scanned for the 'waitfor' prompts every n bytes downloaded.
If your pulling down 1Mb of text data, this buffer can get very large, so the code is constantly cycling over this entire 1Mb of data looking for the waitfor prompt-- essentially doing the same work multiple times.
I have made some Temporary "belt and braces" modifications to Telnet.pm, which only scan the list n bytes of the buffer instead, and I've improved the performance by at least over 5 times. (The more data you pull, the more CPU it saves).
Can someone have a look at this?
It'd be great if this could be fixed in a future distribution, rather than me manually modifying Telnet.pm everywhere :o)
Regards,
Adam.