On Friday, November 02, 2001, Alfred Perlstein wrote: > > I'm curious--does using fgetln here always result in a win, or just > > with short lines? I'm thinking of the impact of realloc and memcpy > > on speed. > > Ugh, I should have checked that, my guess is that performance > isn't going ot be much worse, if there is a real problem > I'll rework it some more, possibly using fread instead of > fgetln.
Well, fgetln should probably be quicker than fread, due to the fact that fgetln will buffer the next incoming line and return a pointer into the stdio internal buffer, while fread has to copy out N times into a separate buffer (also from the read buffer). -- +-------------------+------------------------------------------+ | Chris Costello | ...now touch these wires to your tongue! | | [EMAIL PROTECTED] | | +-------------------+------------------------------------------+ To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message

