Xref: news2.mv.net comp.os.msdos.djgpp:5192 From: Hartmut Schirmer Newsgroups: comp.os.msdos.djgpp Subject: Re: Speed optimization: memcpy() or for loop ?? ** Some actual test results ** Date: 20 Jun 1996 08:05:21 GMT Organization: Technische Fakultaet Lines: 22 Message-ID: <4qb0o1$9r@purzel.techfak.uni-kiel.de> References: <4pmlrp$p7u AT crc-news DOT doc DOT ca> <31C2577D DOT 22FD99BD AT alcyone DOT com> <4q679q$4op AT snlsu1> <4q9k75$bgg AT crc-news DOT doc DOT ca> NNTP-Posting-Host: zora.techfak.uni-kiel.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: richard DOT young AT crc DOT doc DOT ca DJ-Gateway: from newsgroup comp.os.msdos.djgpp richard DOT young AT crc DOT doc DOT ca (Richard Young) wrote: >> Richard Young wrote: >> > A question for the optimization experts: >> > For moving data, is it faster to use >> > >> > a) memcpy(x,y,n*sizeof(x[0])) >> > or >> > b) for (i = 0; i < n; i++) x[i] = y[i]; >> > >> > or are they basically the same speed. > > >The results are: NO DIFFERENCE. > Note: memcpy speed is independent from selected optimization ! -- Hartmut Schirmer | Phone: +49-431-77572-709 FAX: -703 Automatisierungs- u. Regelungstechnik, | hsc AT techfak DOT uni-kiel DOT d400 DOT de Technische Fakult"at, Universit"at Kiel,| http://www.techfak.uni-kiel.de/~hsc Kaiserstr. 2, D-24143 Kiel, Germany | PGP key via WWW, Key ID:6D84AEC1