Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site lsuc.UUCP Path: utzoo!lsuc!dave From: dave@lsuc.UUCP (David Sherman) Newsgroups: net.news,net.unix Subject: massive rn speedup Message-ID: <481@lsuc.UUCP> Date: Wed, 6-Mar-85 09:12:32 EST Article-I.D.: lsuc.481 Posted: Wed Mar 6 09:12:32 1985 Date-Received: Wed, 6-Mar-85 10:20:19 EST Organization: Law Society of Upper Canada, Toronto Lines: 37 Somebody asked a while back about ways of "speeding up UNIX", and I posted a reply about using setbuf to buffer stdout. I decided to take my own advice and try it on rn. The results on our site are amazing. (This is a Perkin-Elmer 3220 running v7, hardwired at 19,200 baud; your mileage may vary.) I changed rn to spit out articles a line at a time instead of a character at a time. Now articles flash up in no time instead of slowing down for all those write(2) system calls (say 1,500 of them per screen). If enough people want my changes, I'll post them; or you can do it yourself. All it takes is a setbuf on stdout at the beginning of main(), and fflush(stdout)'s whenever you want your stuff to come out (grep put and grep printf). I introduced one non-portable change, to make it easy. That was to compile the source with -Dprintf=Dprintf, and write: Dprintf(str,a,b,c,d,e,f,g,h,i,j) register char *str; { #undef printf printf(str,a,b,c,d,e,f,g,h,i,j); fflush(stdout); } This is not portable to all machines, although I believe it works on VAXen and many others. If it doesn't work for you, and you want the particular printf calls buffered, you have to go in with the editor and stick in fflush(stdout) where appropriate. Dave Sherman The Law Society of Upper Canada Toronto -- {utzoo pesnta nrcaero utcs hcr}!lsuc!dave {allegra decvax ihnp4 linus}!utcsri!lsuc!dave