Explanation, please!

Lawrence V. Cipriani lvc at cbnews.ATT.COM
Tue Aug 30 22:56:52 AEST 1988


In article <ac4GLe9fit1010twl3. at amdahl.uts.amdahl.com> chuck at amdahl.uts.amdahl.com (Charles Simmons) writes:
	[discussion of Duff copy deleted]
>I then added a piece to the program to use 'memcpy'.  The results?
>Duff beats a simple loop by 10%.  'memcpy' is 9 times faster than
>Duff.  So why do people spend so much time avoiding standard subroutines?

Sometimes the standard subroutines are implemented horribly.  I was
horrified when I saw that the machine dependent version of memcpy
on the AT&T 3Bs is nothing but a byte by byte transfer written in
assembly language.  It is tricky, but doable, to speed this up by a
roughly a factor of sizeof(long).  In fact it already is done in the
3B implementation of the UNIX(tm) operating system in the copyin (?)
routine.  Why wasn't it done in memcpy too?  Sigh.

-- 
Larry Cipriani, AT&T Network Systems, Columbus OH, cbnews!lvc lvc at cbnews.ATT.COM



More information about the Comp.lang.c mailing list