As brother marto says... how slow is it in comparison ?And what total time is involved here ?
I'm trying to think how the request/response you are doing by hand would differ from what Lynx would be doing... lookup DNS, open TCP connection, send request, collect reply, close TCP connection. It's hard to see what could be different -- assuming the request is the same. I would expect the time to be dominated by network operations and server load, unless the server is very local (on the same machine or in the LAN, perhaps).
So, are you sure that the Perl code and Lynx are performing markedly differently under roughly the same network conditions, and with the server roughly equally loaded ? I'd test both methods in quick succession to try to eliminate that sort of variation (a number of times). If the DNS lookup is a significant part of the time, a ping or something just before that test should cause any cache to be filled, minimising the variability cause by DNS.
If there's still a definite speed difference, it's possible that the Lynx is being clever. I would tcpdump what Lynx and what the piece of Perl does, and see if Lynx is getting the TCP Window to open larger or faster. Or try strace to see how sockets are being driven differently.
In reply to Re: My first socket program is SLOW?
by gone2015
in thread My first socket program is SLOW?
by ttlgreen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |