List Archive: gentoo-performance
Note: Due to technical difficulties, the Archives are currently not up to date.
provides an alternative service for most mailing lists.c.f. bug 424647
Uwe Thiem wrote:
> -funroll-loops isn't that good an idea because an unrolled loop might the
All this started with Artur Grabowski's mail. And now everybody is
repeating his idea.
No, loop unrolling is not evil. Neither are inline functions.
The following loop:
is unrolled like
Some modulo logic must be added and I also omitted the after-loop cleanup.
The gain is less frequent loop index variable comparison (and so a
conditional jump), more register usage, less memory operations in more
complex, nested loops, and a code which allows the scheduler to make
more aggressive optimization in the code structure. And it also opens
possibilities to other optimizations.
All this compared to the increased instruction cache usage. And keep in
mind that every program spends most of its runtime in loops.
This was the theory. Practice shows that the optimizer in gcc was very
weak before 3.4, and sill depends the efficiency of the scheduler.
But remember: however good all this sounds, there are always programs
where one or more optimization fails - there is no magic switch for a
general, best performance.
firstname.lastname@example.org mailing list