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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.