Episode 11: Making It Fast
This post originally appeared on the Software Carpentry website.
Today's episode is the last in the series on program design using invasion percolation as an example. In it, we look at how to make the program we've developed so far run zillions of times faster. It's the longest episode so far, and probably the most difficult, but it makes two very important points:
- The biggest performance gains come from improvements to algorithms and data structures, not from tweaking loops and rearranging conditionals.
- If you want to write a fast program, you should start by writing a simple one, test it, and then rewrite it piece by piece, re-testing as you go along.
Here's the complete list of episodes:
- Introduction
- The Grid
- Aliasing
- Randomness
- Finding Neighbors
- Resolving Ties
- Assembling the Program
- Bugs
- Refactoring
- Testing
- Tuning