micro-optimizing loops (was Help with casts)

Conor O'Neill conor at lion.inmos.co.uk
Thu Feb 28 02:15:22 AEST 1991


In article <10191 at dog.ee.lbl.gov> torek at elf.ee.lbl.gov (Chris Torek) writes:
>Of course, the best optimization for:
>
>	for (i = 1; i < 100; i++)
>		x += i;
>
>is:
>
>	x += 4950;


No.
Try
        { x += 4950; i = 100; }




---
Conor O'Neill, Software Group, INMOS Ltd., UK.
UK: conor at inmos.co.uk		US: conor at inmos.com
"It's state-of-the-art" "But it doesn't work!" "That is the state-of-the-art".



More information about the Comp.lang.c mailing list