Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/17/84; site hao.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!ihnp4!pesnta!hplabs!hao!pag From: pag@hao.UUCP (Peter Gross) Newsgroups: net.unix Subject: Re: Speed of read vs. fread Message-ID: <1350@hao.UUCP> Date: Wed, 23-Jan-85 01:12:33 EST Article-I.D.: hao.1350 Posted: Wed Jan 23 01:12:33 1985 Date-Received: Fri, 25-Jan-85 09:49:23 EST References: <626@ihlts.UUCP> Organization: High Altitude Obs./NCAR, Boulder CO Lines: 13 > Which is faster, read/write or fread/fwrite? Well, you didn't specify on which version of Unix; that might make a difference. I can speak for 4.2bsd. We have a production job here that was important enough and taking long enough that our director was requesting that we shut the system down while this job ran. We decided that was extreme and wanted to see if we could speed it up. Profiling showed it spent a great deal of time in fread()/fwrite(). We checked the code, and lo and behold, fread/fwrite do single getc/putc's in a loop. Converting to read/write made the program run about 3 times faster. --peter gross hao!pag