Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!spool.mu.edu!munnari.oz.au!mel.dit.csiro.au!yarra!pta!teti!teslab!andrew From: andrew@teslab.lab.OZ (Andrew Phillips) Newsgroups: comp.sys.amiga.programmer Subject: Re: NorthC and BYTE sieve demo Summary: Delete printf line before running timings Message-ID: <1212@teslab.lab.OZ> Date: 5 Mar 91 23:25:27 GMT References: <45620@nigel.ee.udel.edu> Reply-To: andrew@teslab.lab.oz.au (Andrew Phillips) Organization: Technology Evaluation Section, L.A.B., Sydney Lines: 32 In article <45620@nigel.ee.udel.edu> Dennis_Grant@cmr001.bitnet writes: > [ about using BYTE Sieve of Eratosthenes Benchmark with NorthC ] >... > On a PC-XT, it (supposedly) took about 250 seconds. With which compiler? >... > I edited the source code, got rid of the printf("%d\n",prime); >statement inside the main loop, and reran it. Bingo! One loop each second. >(More or less) for a final score of about 100 or so. As expected. > > My conclusion: The printf was taking a LOT of time to execute. > > My question: Is this normal? Could a lowly XT really crank out 1600000 >printfs faster than my Amiga, or is this a quirk of NorthC? (or did BYTE >delete those printfs too?) Any ideas? The printf is *not* part of the benchmark, as should be mentioned somewhere in the textof the Byte article. The benchmark is not designed to test I/O (which would be somewhat operating system dependant anyway). The printf is in there to make sure that the program is working properly and should be deleted before any timings are made. PS Taking 40% of the time of an IBM PC (100/250) does not say much for NorthC. I would expect a good C compiler to produce code five time faster (on a standard 7MHz Amiga vs a standard 5MHz PC clone). Andrew. -- Andrew Phillips (andrew@teslab.lab.oz.au) Phone +61 (Aust) 2 (Sydney) 289 8712