CMU technical report on C language efficiency
chris at umcp-cs.UUCP
chris at umcp-cs.UUCP
Thu Oct 27 09:40:12 AEST 1983
An interesting thing they found was that
i--;
ran slower than
i -= 1;
They thought that was strange, so they looked at the assembly output.
It was the same for both statements. The reason i -= 1 ran faster was
that it was on a longword boundary.
Just goes to show that when you're looking too hard for efficency,
you're probably going to find the wrong thing. Or, as Jon Bentley of
Bell Labs says, "People who deal with bits should expect to get bitten."
(Sorry if I misspelled your name there.)
--
In-Real-Life: Chris Torek, Univ of MD Comp Sci
UUCP: {seismo,allegra,brl-bmd}!umcp-cs!chris
CSNet: chris at umcp-cs ARPA: chris.umcp-cs at CSNet-Relay
More information about the Comp.lang.c
mailing list