Re:Duff's device: do + switch fall-through = loop unrolling
by yan on Thursday August 13, 2009 @01:02PM
(#761206)
It's a cute hack and I'm sure it used to matter. I saw it used in djb's qmail. Is it worth even thinking about it? I don't know. I tend to not be a fan of these micro-optimizations on modern hardware.
[ Parent
| on HN ]
Re:Duff's device: do + switch fall-through = loop unrolling
by adatta02 on Thursday August 13, 2009 @01:38PM
(#761268)
Valid point. You'd probably have to hand inspect the generated ASM to make sure the compiler didn't really dick something up.
Also, with the optimizations on modern chipsets it might not be immediately obvious which implementation will actually run faster.