Linked by Eugenia Loli-Queru on Wed 22nd Mar 2006 18:08 UTC
Thread beginning with comment 107001
To view parent comment, click here.
To read all comments associated with this story, please click here.
To view parent comment, click here.
To read all comments associated with this story, please click here.





Member since:
2005-07-06
That's highly dependent on the algorithm in question. Most "complicated" algorithms I've seen are rarely more than a constant factor of 2 or 3 slower than the simple alternative, and are vastly faster for large data sets. Also, remember that in most cases, performance isn't particularly critical for small data sets anyway. If you're writing an iPhoto competitor, an O(1) algorithm that takes 0.5 seconds with 100 photos is better than an O(n) algorithm that takes 0.1 seconds with 100 photos. Both are "fast enough" for the small case, but the former is far better for the cases where performance will truely be relevant --- large data sets.
More generally, my point is that if you're trying to figure out what makes software slow, don't look at the ASM, look at the algorithms. Excess I/O, excess IPC, bad asmyptotic behavior, cache thrasing, etc, are all far more likely candidates than a few wasted cycles here or there.