Linked by Thom Holwerda on Fri 13th Feb 2009 16:19 UTC, submitted by ShlomiFish
General Development There's a new essay called "Optimizing Code for Speed" available on Shlomi Fish's site. It covers the motivation, methods and terminology of optimizing code, and provides many links and examples to illustrate this important subject.
Permalink for comment 349263
To read all comments associated with this story, please click here.
RE: Comment by wkleunen
by m3metix on Mon 16th Feb 2009 15:21 UTC in reply to "Comment by wkleunen"
m3metix
Member since:
2009-02-16


Even complexity optimizations don't always work out the way you think. Maybe for N=1000 a N Log N sort is faster than a N^2 sort, but for N=5, maybe the N^2 sort if both smaller and faster.


This is true. I have used bubble sort, which is O(N^2), in a case where N was guaranteed to always be 5 (a hand of 5 cards), since it is a simple algorithm to write and understand and the speed was more than adequate.

Reply Parent Score: 1