Skip to content

Instantly share code, notes, and snippets.

@gtallen1187
Created November 2, 2015 00:09
Show Gist options
  • Save gtallen1187/27c3472e0b3515499ccb to your computer and use it in GitHub Desktop.
Save gtallen1187/27c3472e0b3515499ccb to your computer and use it in GitHub Desktop.

"The greatest performance improvement of all is when a system goes from not-working to working"

From a lecture by Professor John Ousterhout at Stanford.

Programmers tend to worry too much and too soon about performance. Many college-level Computer Science classes focus on fancy algorithms to improve performance, but in real life performance rarely matters. Most real-world programs run plenty fast enough on today's machines without any particular attention to performance. The real challenges are getting programs completed quickly, ensuring their quality, and managing the complexity of large applications. Thus the primary design criterion for software should be simplicity, not speed.

Occasionally there will be parts of a program where performance matters, but you probably won't be able to predict where the performance issues will occur. If you try to optimize the performance of an application during the initial construction you will add complexity that will impact the timely delivery and quality of the application and probably won't help performance at all; in fact, it could actually reduce the performance ("faster" algorithms often have larger constant factors, meaning they are slower at small scale and only become more efficient at large scale). I've found that in most situations the simplest code is also the fastest. So, don't worry about performance until the application is running; if it isn't fast enough, then go in and carefully measure to figure out where the performance bottlenecks are (they are likely to be in places you wouldn't have guessed). Tune only the places where you have measured that there is an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment