mp@allegra.UUCP (Mark Plotnick) (08/25/85)
Someone here discovered that you can speed up ethernet uucp transfers ('e' protocol in honey-danber uucp) by up to 2x by changing the fread/fwrites in eio.c to read/writes. They're still surrounded by fopen/fclose, though, since cntrl.c wasn't touched. Note that the resulting reads and writes are the only routines called to do i/o here; they aren't being intermixed with other freads, fwrites, putchars, or anything like that. Although this works OK under 4.2bsd and V8, I'm wondering what will happen if we run the new uucp on systems such as Ultrix and Sun, in which we can't examine the source code to fopen/fflush/fclose. Does anyone know if we could run into any problems here? Mark Plotnick allegra!mp
tanner@ki4pv.UUCP (Tanner Andrews) (08/28/85)
] note referenced asks how safe it is to use read(2) with files ] opened using fopen(3) If you do not extract the file descriptor from the fp structure returned by fopen(2), many systems won't like it. The pointer value from fopen(3) is not likely to make a good fd. If you do extract the fd, chances are reasonably good that it will work. Of course, you must either (a) not be buffering your i/o, or (b) flush your buffers before you use read(2)/write(2). As good form you do well not to intermix section 2 i/o calls and section 3 i/o calls on the same file. Consider using open(2). -- <std dsclm, copies upon request> Tanner Andrews, KI4PV uucp: ...!decvax!ucf-cs!ki4pv!tanner
honey@down.FUN (Peter Honeyman) (09/06/85)
note that the fread/frwite calls are to the file being transferred, not to the i/o channel. i applied this fix to e, x, d, and even g, i.e., to all the protocols, since they were all freading and fwriting in BUFSIZ units. i didn't bother to measure the speedup ... peter ps: it appears this observation was made independently and simultaneously by norman wilson and mike bianchi. obviously, an idea whose time had come.
rick@seismo.CSS.GOV (Rick Adams) (09/12/85)
You also get a big win by changing xcp() to use reads and writes instead of fread/fwrite with a small buffer size. --rick