TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: CAREY BLOODWORTH
from: HERMAN SCHONFELD
date: 1997-05-03 23:22:00
subject: LOW LEVEL OPTIMIZATIO 1/2

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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.