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

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
And, hopefully, to realize that optimizing for CPU cycles in a language running in a 10-year old VM is rather silly.

And yet, every time someone comes around asking how do I search my array for a given value, the standard answer is "use a hash". I'm pretty sure that we could dig up a post of yours offering the same advice. Of course, we could also suggest grep, but mostly we don't unless duplicate values must be maintained, because the hash solution is quicker. It can lead to duplication of memory usage, and some additional complexity, but for most purposes, it's a more optimal solution.

And then there's the case of the small business running a web site on a rented server. For 95% of what he needs, his current installation works perfectly, but there's that one dratted cgi that just takes too darn long and he's getting complaints. Options:

  1. Rent a better server.

    Means making a wholesale move to a different hoster because he's already using their most powerful offering.

    Maybe moving to a dedicated server rather than a virtually hosted one.

    Either involves costs that go beyond just the costs of better hardware.

  2. Or spreading his load across 2 machines.

    But that doesn't work because the slow part of the process is cpu bound, and the second machine is the same spec as the first. Splitting the slow process across two machines means huge complication and expense for clustering software.

    Not to mention the requirement to purchase expertise he doesn't have.

    Not to mention that doubling his hardware costs would cut directly into his profit margins.

  3. Profile the errant code and see what he can do to speed it up.

Or the case of the hobbyists, college kids, and guys developing programs for friends, or aimed at the home market.

Requiring C/C++ compilers, and the skills to use them, isn't an option.

Requiring a $4000 high end server to run their programs isn't an option either.

If it doesn't run effectively on a reasonably configured typical home system, it won't be usable.

The corporate world is not the only world. And far from all the people that come to PM seeking solutions to their problems live in that world. In fact, I would suggest that those that have the option of throwing hardware at performance issues are probably in the minority.

So the next time you see someone seeking to eek out the performance of the hardware they have, by improving the performance of the software they write in that language they know. The language that specifically sets out to not being the exclusive preserve of professional programmers. By all means sit back and feel smug that you have that option, and by all means feel free to move quickly on to posts dealing with more professional matters.

But please, don't berate them for not having the option, or for seeking to spend their time, optimising their code, to make best possible use of the hardware that they have.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re^7: CPU cycles DO NOT MATTER! by BrowserUk
in thread CPU cycles DO NOT MATTER! by dragonchild

Title:
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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-04-19 13:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found