Efficiency Question

Chengi Jimmy Kuo cjkuo at locus.com
Wed Feb 27 11:46:23 AEST 1991


ckp at grebyn.com (Checkpoint Technologies) writes:

>In article <1991Feb25.181434.6462 at ux1.cso.uiuc.edu> gordon at osiris.cso.uiuc.edu (John Gordon) writes:
>>	In the above case, the last statement is definitely faster than the
>>first one.  Because: in the first statement, the machine has to load 3 
>>values into 3 registers and deal with them, whereas in the last statement,
>>essentially only 1 register is being used.

>Sorry, this has a lot to do with the machine and compiler involved.  Many will
>compile all three forms to exactly the same thing (which you admit
>later).

Every compiler I have seen since 1982 for 8086 based computers equates all the
original cases.  No differences.

Jimmy Kuo
-- 
cjkuo at locus.com
"The correct answer to an either/or question is both!"



More information about the Comp.lang.c mailing list