From: ao950 AT FreeNet DOT Carleton DOT CA (Paul Derbyshire) Newsgroups: comp.os.msdos.djgpp Subject: Loop unrolling: Don't bother Date: 28 Feb 1997 03:51:15 GMT Organization: The National Capital FreeNet Lines: 24 Message-ID: <5f5knj$cho@freenet-news.carleton.ca> Reply-To: ao950 AT FreeNet DOT Carleton DOT CA (Paul Derbyshire) NNTP-Posting-Host: freenet5.carleton.ca To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp I have determined that loop unrolling produces very little speed gain. A loop such as register int i,j; for (i=0; i<15; i++) { /* simple arithmetic */ for (j=0; j<21; j++) { /* Function call and some math */ } /* More math */ } compiled with -O3 and a manually-unrolled loop (using macros) also compiled with -O3 don't run at appreciably different rates. -- .*. Where feelings are concerned, answers are rarely simple [GeneDeWeese] -() < When I go to the theater, I always go straight to the "bag and mix" `*' bulk candy section...because variety is the spice of life... [me] Paul Derbyshire ao950 AT freenet DOT carleton DOT ca, http://chat.carleton.ca/~pderbysh