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

Re^3: CPU cycles DO NOT MATTER!

by moritz (Cardinal)
on Apr 17, 2008 at 15:19 UTC ( #681188=note: print w/replies, xml ) Need Help??

in reply to Re^2: 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

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).

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2022-12-07 17:42 GMT
Find Nodes?
    Voting Booth?

    No recent polls found