delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/02/06:18:06

Date: Sun, 2 Mar 1997 13:10:08 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Paul Derbyshire <ao950 AT FreeNet DOT Carleton DOT CA>
cc: djgpp AT delorie DOT com
Subject: Re: Loop unrolling: Don't bother
In-Reply-To: <5f5knj$cho@freenet-news.carleton.ca>
Message-ID: <Pine.SUN.3.91.970302130946.6609F-100000@is>
MIME-Version: 1.0

On 28 Feb 1997, Paul Derbyshire wrote:

> 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.

This really doesn't tell much, unless you post both the
exact source code that you compiled, the method used to time it, and
the results of the timing.

Anyway, at the first glance, calling a function inside a loop will
usually obscure any effect of loop unrolling, at least in my
experience.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019