Good code can't improve your bandwith,...

I sit on the end of a 56k connection. Most of the time my best connect speed is around 44k. If I'm downloading large files from a remote server, using a threaded downloader with 3 or 4 threads, I will often (appear to?) get greater throughput than with a single threaded but very efficient downloader like wget.

Despite that the same pipe, same connection speed, same file from the same server, even the same session. If I let wget run for a while to get it's throughput measurement, interrupt it and switch to a threaded downloader, the threaded downloader sometimes shows a few % higher throughput.

Now it could be just that the two calculate their throughput in different ways but I do not think that is the case as both are consistant with the Task Manager Networking bandwidth monitor. That is to say, during the same connection, a download with one, immediately followed by a download with the other, and the system throughput monitor also shows the threaded downloader to get greater throughput than wget.

My supposition is that with the narrow pipe, most servers are capable of driving the pipe as fast as it can go, therefore there is always data available to be read by the app locally. However, sometimes the app has to send acks, write to disk, update the progress bar when it could be reading the next packet.

In the multi-thread app., there is always another thread available to read it's next packet, when the the first thread is waiting for a disk write to complete or is updating the screen. In the single-threaded wget, these other events detract from the throughput.

That's my theory--the theory which is mine. Dinosaurs are thin at one end, thick in the middle, and thin again at the other end (Wrong show!)


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail        "Time is a poor substitute for thought"--theorbtwo
"Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon

In reply to Re^3: Copy Files from network by BrowserUk
in thread Copy Files from network by gpurusho

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.