CB>Unrolling can help. Pointers slow it down. I've timed it. Contrary to
CB>popular convention, pointers are _not_ automatically faster than
CB>indexing.
Use an average consumer machine to test out your programs then come back with
results.
HS>But according to you, unrolling is bad, then use Duffs Device.
CB>In some cases, yes. In other cases no. It depends a lot on how much
CB>the loop does. This is especially true when you tell the compiler to
CB>unroll loops with an optimization switch such as -O3 for DJGPP.
lies!
-O3 unrolls no loops.
CB>Yes it does use a register. But even on the register poor x86
CB>architecture, most compilers will keep all three variables in registers.
CB>Only my 8 year old QC20 doesn't bother to keep _any_ of them in
CB>registers.
lies!
With optimizations turned on, my compiler removes unused variables from
registers which can be used for something else.
... In DOS we trust.
--- Ezycom V1.48g0 01fd016b
---------------
* Origin: Fox's Lair BBS Bris Aus +61-7-38033908 V34+ Node 2 (3:640/238)
|