Tom Duff
Tom Duff is a software engineer notable for his contributions to computer graphics and his discovery of "Duff's device," an unusual and highly optimized code construct in the C programming language.
Duff received his Ph.D. in Computer Science from the University of Toronto and later worked at Lucasfilm, where he contributed significantly to the development of the compositing software Composer, used in the film Star Wars: Return of the Jedi. His work focused on alpha compositing, a technique used to combine images and create transparency effects.
He is best known for Duff's device, a loop unrolling optimization technique implemented in a non-standard way that leverages the C language's syntax to achieve greater efficiency in certain data copying scenarios. The device works by interleaving a switch
statement with a while
loop, allowing for very precise and fast copying of memory blocks. This unorthodox use of language features generated considerable discussion and debate within the programming community, highlighting both the power and potential for misuse of the C language.
Beyond his technical achievements, Duff is also recognized for his insightful and often humorous commentary on programming and computer science, shared through online forums and communities.