I wonder what programmers at the time would think of CPUs eventually being so good at handling loops that unrolling changes from an optimisation technique to be performed manually, to one that compilers might sometimes do, to an anti-optimisation:<p><a href="http://www.agner.org/optimize/blog/read.php?i=142" rel="nofollow">http://www.agner.org/optimize/blog/read.php?i=142</a><p><i>It is so important to economize the use of the micro-op
cache that I would give the advice never to unroll loops.</i><p><a href="http://lkml.iu.edu/hypermail/linux/kernel/0008.2/0171.html" rel="nofollow">http://lkml.iu.edu/hypermail/linux/kernel/0008.2/0171.html</a><p><i>by eliminating all instances of Duff's Device from the XFree86 4.0 server, the server shrunk in size by _half_ _a_ _megabyte_ (!!!), and was faster to boot</i>
"A second poster tried the test, but botched the implementation, proving only that with diligence it is possible to make anything run slowly."<p>This made me laugh. "with diligence it is possible to make anything run slowly" should be one of the truths carved into an obelisk outside every CompSci department or at least on a t-shirt.
> (Actually, I have another revolting way to use switches to implement interrupt driven state machines but it's too horrid to go into.)<p>I'm really, really curious about what that code is.