[comp.sys.mac.programmer] Think 'C' vs MPW file i/o

wrp@krebs.acc.Virginia.EDU (Bill Pearson) (02/18/90)

	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