Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!nic.MR.NET!xanth!mcnc!ncsuvx!cccvs1.ncsu.edu!rcb From: rcb@cccvs1.ncsu.edu (Randy Buckland) Newsgroups: comp.sys.mac Subject: Re: New Mac Rumours Message-ID: <2606@ncsuvx.ncsu.edu> Date: 28 Feb 89 14:06:21 GMT References: <41a2364a.a590@mag.engin.umich.edu> <70755@ti-csl.csc.ti.com> <41aa5eaa.a590@mag.engin.umich.edu> <15682@versatc.UUCP> Sender: news@ncsuvx.ncsu.edu Reply-To: rcb@cccvs1.ncsu.edu.UUCP (Randy Buckland) Organization: North Carolina State University Lines: 31 For general amusement, try looking at the generated code for the following in LightSpeed C 3.0 strcpy (out, in) char *out, *in; { while (*in) *out++ = *in++; } as opposed to strcpy (out, in) char *out, *in; { while (*in) { *out = *in; out++; in++; } } The first looks like it should be more efficient and would be on some machines with the right compiler, However in LightSpeed C, the second is drastically more efficient due to the order the operations are carried out in. It gets even better if the pointers are optimised into registers or explicitly copied into registers. Randy Buckland rcb@ncsuvx.ncsu.edu