Episode 11: Making It Fast
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

I really liked the whole lecture and thought that it did a really nice job of illustrating general concepts by showing a specific example. I did notice that the actual programming material was substantially more difficult to keep up with than the conceptual development; so it may be worth thinking about trying to speed up the conceptual aspects to allow more time per slide on the programming material. That said, the programming is what folks like me are coming here to learn, so it’s probably going to be more challenging than the setup by definition.