Duff's device
Dispositivo de Duff
- Date
- 1983 · confidence high
- Place
- San Rafael, California, United States
- Credited to
- Tom Duff
- Field
- Knowledge & symbols
What it is
A C programming technique that interleaves a do-while loop with a switch statement to manually unroll loops and reduce iteration-control overhead, discovered by Tom Duff while working at Lucasfilm.
What it led to
- Loop-optimization techniques in compilers
- A celebrated example of C's syntactic flexibility
- Later use in high-performance graphics and systems programming