Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site unrvax.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!whuxlm!harpo!decvax!genrad!panda!talcott!harvard!seismo!utah-cs!utah-gr!stride!unrvax!ron From: ron@unrvax.UUCP (Ron Sheen) Newsgroups: net.sources.bugs,net.unix-wizards Subject: Re: Funny behaviour of bm under V7 Message-ID: <385@unrvax.UUCP> Date: Thu, 22-Aug-85 13:27:49 EDT Article-I.D.: unrvax.385 Posted: Thu Aug 22 13:27:49 1985 Date-Received: Sun, 25-Aug-85 01:09:49 EDT References: <6591@boring.UUCP> Reply-To: ron@unrvax.UUCP (Ron Sheen) Organization: Univ. of Nev., Reno-Seismology Lines: 27 Xref: watmath net.sources.bugs:458 net.unix-wizards:14528 We also found bm to be slow under 2.9. The problem is that bm reads from its input file into a buffer at possibly and odd address and possibly (usually) not a multiple of 512 bytes. The following changes brought bm's performance more in line with what was expected: In Execute.c: line 42 reads from the input file into Buffer, change: read(TextFile,Buffer + ResSize + NRead, NWanted); to: read(TextFile,Buffer + ResSize + NRead, (NWanted>>9)<<9); In MoveResidue.c: lines 29-31 move the residue in Buffer to the beginning of buffer. t=Buffer; f=Residue; for(i=ResSize;i;i--) *t++ = *f++; add the following to insure the next read occurs on a word boundary: /* check if next word is at an odd address */ if((int) (t - Buffer) & 1) { *t = '\0'; ResSize++; } Ron Sheen seismo!unr70!ron