I liked this post from BrowserUK and up-voted it.

Implementation is indeed "king"!
One problem with theoritcal "O-n" notation is "how expensive is an O?"

I remember one of my first programming assignments on 1960's hardware.
We were using wire-wrap technolgy for H/W prototypes. The basic software task was to sort thousands of punch cards and produce an output.

We had a port of our mainframe code that would run on our lab machine.
But it took 6 hours to run!
It used the minimum number of compares between card images, but it was very,very slow.

Using a bi-directional indexed bubble sort and a fancy merge, I was able to reduce the time from 6 hours to 5 seconds!

That doesn't seem possible, but it was possible.
These ancient machines with 24K words of memory were slow. My coffee pot probably has a faster processor albiet with not as much memory?!

I understood the problem very well.
My code had no O/S or file system.
Essentially, I wrote it on the "bare metal".
Yes, this was a "one trick pony", but it could do its trick very, very well.
I could calculate partial results as the punch cards were read in, while still allowing the card reader to run at full speed.
On the output, I could calcuate results fast enough so that the ancient shuttle line printer ran at a maximum rate.
The 5 second number is the "dead time" when no I/O is happening at the max rate.


In reply to Re^7: Out of Memory when generating large matrix by Marshall
in thread Out of Memory when generating large matrix by cathyyihao

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.