Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: CPU cycles DO NOT MATTER!

by dragonchild (Archbishop)
on Apr 17, 2008 at 14:40 UTC ( [id://681176]=note: print w/replies, xml ) Need Help??


in reply to Re: CPU cycles DO NOT MATTER!
in thread CPU cycles DO NOT MATTER!

Sure. Algorithms can matter. But, they only do so now when dealing with large datasets. As systems get larger, the size of datasets where algorithm choice doesn't matter also gets larger proportionately. So, heapsort vs. bubble-sort matters a lot when working with randomized arrays of 100_000 elements. It doesn't matter at all when dealing with arrays of 1_000 elements. In 3 years, 100_000 elements will be moot.

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

Replies are listed 'Best First'.
Re^3: CPU cycles DO NOT MATTER!
by moritz (Cardinal) on Apr 17, 2008 at 15:19 UTC
    Sure. Algorithms can matter. But, they only do so now when dealing with large datasets

    But "large" depends strongly on the algorithm.

    I remember reading a node here (can't find it, sorry) about a regex taking exponential time matching some piece of HTML.

    For an algorithm that needs exponential time a line of 80 chars can be long. Really. In 10 years that limit might be 100. Or 120.

    Typical examples are the knapsack problem that appear in real world applications over and over again, which takes exponential time when solved with brute force. Approximation algorithms can solve it much faster, even if a bit inaccurate.

    I'm sure even you would argue that you should optimize when a O(2**n) code hits you.

    But if you normally don't optimize, you have no feeling for what is slow and what isn't, don't know about profiling etc. Which is why I do optimize my applications from time to time.

    BTW a real world project that has been hit by missing optimizations recently is the KindaPerl6 compiler, which was so slow during bootstrap that it just wasn't practicable anymore. It took the fun out of the development process, and now I haven't seen a single kp6 commit since... lemme check... 2008-03-16. (Surely this wasn't the only problem, but IMHO it was the one with largest impact).

    A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://681176]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (7)
As of 2024-04-24 10:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found