From: nikki AT gameboutique DOT co (nikki) Newsgroups: comp.os.msdos.djgpp Subject: Re: Loop unrolling: Don't bother Date: 28 Feb 1997 07:29:48 GMT Organization: GameBoutique Ltd. Lines: 21 Message-ID: <5f61hc$nkg@flex.uunet.pipex.com> References: <5f5knj$cho AT freenet-news DOT carleton DOT ca> NNTP-Posting-Host: www.gameboutique.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp > 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 */ > } hardly a great surprise seeing as the loop above would quite probably fit in the cache when well optimised, but unrolled would thrash it horribly. unrolling loops won't save an enormous amount of time, after all a jump instruction will only take you 3 or 4 cycles at most. nik -- Graham Tootell nikki AT gameboutique DOT com