Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!mit-eddie!bloom-beacon!tut.cis.ohio-state.edu!ucbvax!agate!saturn!ray From: ray@saturn.ucsc.edu (Ray Swartz) Newsgroups: comp.lang.c Subject: What looks efficient may not be Summary: ++i is not i++ Keywords: efficiency, increment operator Message-ID: <7703@saturn.ucsc.edu> Date: 27 May 89 15:24:07 GMT Reply-To: ray@saturn.ucsc.edu (Ray Swartz) Distribution: usa Organization: University of California, Santa Cruz Lines: 17 I recently was surprised to discover that while (i < 500000) ++i; ran much faster than while (i < 500000)) i++; The test ran on a 68020 based machine. This test was run without using the optimizer. Here is yet another example that shows that optimizing from a higher level language may backfire. Incidentally, I realize the loops don't do anything, I was testing some alternatives ways of doing timing loops.