Xref: utzoo comp.lang.c:12145 comp.arch:6172 Newsgroups: comp.lang.c,comp.arch Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: Explanation, please! Message-ID: <1988Aug28.010019.17233@utzoo.uucp> Organization: U of Toronto Zoology References: <653@paris.ICS.UCI.EDU> Date: Sun, 28 Aug 88 01:00:19 GMT In article <653@paris.ICS.UCI.EDU> schmidt@bonnie.ics.uci.edu (Douglas C. Schmidt) writes: >After some quick testing I found that gcc 1.26 -O on a Sun 3 and a >Sequent Balance was pretty heavily in favor of the regular (non-Duff) >loop... The odds are excellent that the compilers are applying optimizations to the regular loop that they can't do for the Duff loop as you've written it. In particular, your pointers aren't even register variables (and they are externs, so the compiler can't safely promote them quietly), whereas a good optimizing compiler will certainly be using register pointers in the regular loop. My partner in crime, Geoff Collyer, applied Duff's Device in a number of places in the C News rnews; the performance improvements were substantial. -- Intel CPUs are not defective, | Henry Spencer at U of Toronto Zoology they just act that way. | uunet!attcan!utzoo!henry henry@zoo.toronto.edu