Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!apple!usc!julius.cs.uiuc.edu!rpi!crdgw1!sixhub!davidsen From: davidsen@sixhub.UUCP (Wm E. Davidsen Jr) Newsgroups: comp.benchmarks Subject: Re: Ole Swang's benchmark: Sum of Harmonic Series Message-ID: <2720@sixhub.UUCP> Date: 23 Dec 90 17:06:05 GMT References: <44125@mips.mips.COM> <1990Dec19.004003.20667@dirtydog.ima.isc.com> Reply-To: davidsen@sixhub.UUCP (bill davidsen) Organization: *IX Public Access UNIX, Schenectady NY Lines: 21 In article <1990Dec19.004003.20667@dirtydog.ima.isc.com> suitti@ima.isc.com (Stephen Uitti) writes: | The do-while is faster. On the 386/25 with 387, the "for" loop | took 101.6 seconds, and the "do-while" loop took 99.8 seconds. Nope. You have changed both the loop type and the algorithm here. The corresponding for loop would be for (n=100000; --n; ) { ... } and the reason your version runs faster is that it avoids the compare, not because it's a do-while. As in most benchmarks the effect of changing the program to make it faster also means the numbers no longer compare to the old values in a meaningful way. -- bill davidsen - davidsen@sixhub.uucp (uunet!crdgw1!sixhub!davidsen) sysop *IX BBS and Public Access UNIX moderator of comp.binaries.ibm.pc and 80386 mailing list "Stupidity, like virtue, is its own reward" -me