Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!uvaarpa!murdoch!krebs.acc.Virginia.EDU!wrp From: wrp@krebs.acc.Virginia.EDU (Bill Pearson) Newsgroups: comp.sys.mac.programmer Subject: Think 'C' vs MPW file i/o Message-ID: <1990Feb18.021804.18148@murdoch.acc.Virginia.EDU> Date: 18 Feb 90 02:18:04 GMT Sender: news@murdoch.acc.Virginia.EDU Reply-To: wrp@krebs.acc.Virginia.EDU (Bill Pearson) Distribution: usa Organization: Academic Computing Center, University of Va. Lines: 20 I recently converted a program that scans and analyzes the contents of at 4 mbyte file from Think 'C' to MPW 'C', in order to take advantage of 32 bit ints. To my surprise, the program was about 1/2 as fast under MPW 'C' (running under the MPW shell). Even when the program was compiled to use 68020 codes, it still took 50% longer to run. My Think version used to take about twice as long, until I increased the file read buffer size with setvbuf(). I have also done this with the MPW version, but I am suspicious that setvbuf() may not really work under MPW C 3.0. I note that in stdio.h, the FILE data structure only uses an unsigned short for the buffer size. Since MPW C does not supply source for the libraries, I cannot check. Thus, I have two questions: Does the MPW shell slow things down substantially? Does setvbuf() work properly under MPW 'C'? (Really I only have one question, how do I make my program run as fast under MPW as it does under Think 'C'?) Bill Pearson