[comp.lang.c] memcpy, memmove, etc

chris@mimsy.umd.edu (Chris Torek) (08/02/90)

In article <A2072777983@thelake.mn.org> steve@thelake.mn.org
(Steve Yelvington) writes:
>For collectors of useless numbers, here are results ....

Actually, they are not entirely useless.  Since gencpy() is faster when
copying longs than is library memcpy(), that suggests that the library
routine could be improved.

>The dLibs memcpy is coded in assembler, moves 16-bit words when possible,
>and DOES check for overlaps (as in memmove). The copy is a simple loop.
>Loading and dumping registers with movem.l might be faster; I have not tried.

Since the machine is a 68000 box (not a 68010 or 68020), yes, moving
via movem is faster (provided you code it correctly).

Making memmove fast is tricky, but it *is* important for many
applications: a surprising amount of computer time is spent moving
huge amounts of largely useless data from point A to point B.  It is
just like rush hour. :-)  (This analogy was intended to be entirely
humorous, but now that I have thought about it a bit, it goes rather
deeper.  Like rush hour traffic, much of that data copying could be
eliminated by just being a bit smarter in the first place.)
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@cs.umd.edu	Path:	uunet!mimsy!chris