[4916] in Athena Bugs
libc compat-sys5
daemon@ATHENA.MIT.EDU (John Carr)
Sat May 12 00:10:22 1990
To: bugs@ATHENA.MIT.EDU
Date: Sat, 12 May 90 00:10:10 EDT
From: John Carr <jfc@ATHENA.MIT.EDU>
The functions in /source/bsd-4.3/common/lib/libc/compat-sys5 are in
need of optimization.
On the RT, mem*() should be changed to look like bcopy(), etc (calling
the internal library function blt()). On the VAX, they should call
bcopy (or be copies of it) to make use of the VAX movc3 instruction.
On long strings, the VAX block move instructions are a factor of 10
faster than a simple loop, the RT instructions probably a factor of 2.
str[r]chr() should be identical to [r]index() on VAX and RT.
A better implementation of strtok can be found in the attach sources.
The version installed in our C library is optimized for long strings
(it makes many calls to index()). The version with attach runs much
faster as used in that program.
strcatn() can be rewritten to call strlen().