public-domain string(3)

Henry Spencer henry at utzoo.UUCP
Thu Dec 1 07:11:37 AEST 1983


For those among the audience interested in bit-twiddling efficiency,
I've just had a quick look at how the (pdp11) assembly code for my
string routines compares to that of the V7 routines.  Pretty close.
There are one or two cases where my versions actually do better,
most of the time the V7 routines are a bit better, and the differences
are never large.  Most of the cases where V7 comes out ahead are places
where the V7 code is running a scanning pointer past the beginning or
end of a string and then backing it up to the boundary it went past.
This is a slightly dubious practice if one is very concerned about
portability; on a segmented machine, a pointer that has been backed
up past the beginning of a segment can point heaven-knows-where, and
one might possibly run into problems trying to "backspace" it.  The
absence of this particular trick in my code means that there are a
few places where my routines don't get the full benefit of the 11's
autoincrement addressing modes.  That's about the only difference.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry



More information about the Comp.sources.unix mailing list