Explanation, please!

der Mouse mouse at mcgill-vision.UUCP
Thu Sep 1 19:46:18 AEST 1988


In article <1988Aug28.031926.19222 at utzoo.uucp>, henry at utzoo.uucp (Henry Spencer) writes:
> In article <634 at proxftl.UUCP> bill at proxftl.UUCP (T. William Wells) writes:
>> [Duff's Device]
>> The false god of efficiency has reared it ugly head.
> In general, however, in the long run the correct way to implement
> bulk data copying is to call "memcpy", which (in the long run) is
> likely to be recognized and given special attention by most
> compilers.

Ultimately, Henry is correct (as usual).  However, for people who want
their code to run fast today, when memcpy() is a real routine call, it
is worthwhile to actually time things.  In particular, if you have a
small amount of data to move, the routine call overhead may well be
enough to completely swamp the speedup obtained by using a highly-tuned
copy routine, particularly on machines like the VAX with high call
overhead.

Moral: If you care, take the time to find out how it *really* is.

					der Mouse

			old: mcgill-vision!mouse
			new: mouse at larry.mcrcim.mcgill.edu



More information about the Comp.lang.c mailing list