memcpy versus assignment

Henry Spencer henry at utzoo.uucp
Wed Jan 3 08:57:00 AEST 1990


In article <1989Dec31.005904.1910 at utzoo.uucp> I wrote:
>... (Lest anyone think I'm kidding
>about the factor of 2, I've got an experimental memchr() which, on long
>strings, beats every manufacturer's implementation we've tested by a
>factor of at least 2 and usually 3-4... despite being written in portable
>C rather than assembler.)

Several people have written asking about memchr.  It, along with similar
speedups for a lot of the other string functions, will be in the second
release of my freely-redistributable string library.  The release date is
somewhat uncertain, although "sometime in spring" would be a safe guess.
I need to get the C News to-do list under control before I can spare much
time for strings.

The stuff currently isn't in particularly good shape for distribution.
It works, but the source is a mess, and I'm still experimenting with
further optimizations.  There is nothing proprietary about it, but I'd
prefer not to release it widely until it's cleaned up.

The crucial trick, incidentally, is that one does the search a word at a
time rather than a byte at a time.
-- 
1972: Saturn V #15 flight-ready|     Henry Spencer at U of Toronto Zoology
1990: birds nesting in engines | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list