Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I believe that the core points of this post are very valid, even though the title is somewhat misleading. “CPU cycles,” of course, do matter ... but only in a handful of situations. I don't fault this posting for its title; nor should we. Look beyond that.

“The 80/20 rule” is a familiar maxim that applies over-and-over to our industry in all sorts of useful analogies. Furthermore, most of the things that we actually want a computer to do, do not have CPU clock-speed as their primary, ruling constraint. The speed of any system is ruled by its slowest component. Which is inevitably I/O.

“Input/Output” can appear in unexpected places, though, and it can wear many disguises. For instance, I've spent a lot of time recently working with a group that loved to use hashes: big hashes. Very Big Hashes. Sometimes those hashes were “tied” to a Berkeley DB; sometimes they were not. But they'd sit there wondering why the processes were “so damned slow,” and they'd throw cluster-bombs of computers at those processes and they were still slow. I explained that, while they were well on their way to making a hardware-salesman very happy while they were busting their budget, those algorithms were doomed to be slow forever.

I patiently taught them about virtual-memory, and thrashing, and working-sets and page-faults. Then I taught them about the strategies that were used a half-century ago to do much bigger tasks than these with punched cards (and in much less time). Slowly the mind-shift began to sink in, but I do mean, slowly. But, one by one by one, the programs sure got faster!

One of the very best books on programming I have ever read is The Elements of Programming Style. (I still have the original FORTRAN edition.) Condensed into that tiny volume, in the best tradition of Messrs. Strunk & White, is a cornucopia of practical information elegantly presented. Such as:   Don't “diddle” code to make it faster... find a better algorithm.

A fundamental book on algorithms, such as How To Solve It should also be on your library-shelf and its well-thumbed pages should be chock-full of Post-It™ notes. (Your college “Data Structures” textbook, while arguably very-good, is not the same thing.)

In reply to Re: CPU cycles DO NOT MATTER! by sundialsvc4
in thread CPU cycles DO NOT MATTER! by dragonchild

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

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2022-12-07 16:14 GMT
Find Nodes?
    Voting Booth?

    No recent polls found