Mail Archives: djgpp/1997/03/02/06:18:06
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 -