Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 exptools 1/6/84; site ihlts.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!ihnp4!ihlts!lied From: lied@ihlts.UUCP (Bob Lied) Newsgroups: net.unix Subject: Speed of read vs. fread Message-ID: <626@ihlts.UUCP> Date: Sat, 19-Jan-85 21:36:29 EST Article-I.D.: ihlts.626 Posted: Sat Jan 19 21:36:29 1985 Date-Received: Mon, 21-Jan-85 00:48:35 EST Organization: AT&T Bell Labs, Naperville, IL Lines: 17 Which is faster, read/write or fread/fwrite? I've been told that fread/fwrite is faster because it buffers. On the other hand, I've been told that read/write is faster because (a) read always does a one block read-ahead if it can and (b) it avoids the overhead of the fread/fwrite abstraction. Of the few examples I know personally, read/write seems to win, but I'm not really convinced. Given a choice, and doing I/O in chunks instead of characters, which should I use for performance? Please explain your selection, and no lectures on tuning too early, OK? Bob Lied ihnp4!ihlts!lied