Bad Pistachios and Branch Prediction Penalties

So, one of the problems with stuffing your mouth with pistachios as fast as you can shell them is that you might still have the meat of several perfectly good but under-chewed and unswallowed nuts in your mouth when you start to chew a bad one. What’s worse, it might take a couple of chews before the bad one is really obvious, by which time you’ve probably added a few more nuts. The result is that you have to spit it all out, and then it might take a few more nuts before the flavor is really purged.

This is not unlike the branch-prediction miss penalty suffered by the Pentium IV processor. Only rather than chewing on nuts, its chewing on instructions and data.