Path: utzoo!utgpu!water!watmath!clyde!att!ucbvax!bloom-beacon!mcgill-vision!mouse From: mouse@mcgill-vision.UUCP (der Mouse) Newsgroups: comp.lang.c Subject: Re: Explanation, please! Message-ID: <1278@mcgill-vision.UUCP> Date: 1 Sep 88 09:46:18 GMT References: <638@paris.ICS.UCI.EDU> <634@proxftl.UUCP> <1988Aug28.031926.19222@utzoo.uucp> Organization: McGill University, Montreal Lines: 23 In article <1988Aug28.031926.19222@utzoo.uucp>, henry@utzoo.uucp (Henry Spencer) writes: > In article <634@proxftl.UUCP> bill@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@larry.mcrcim.mcgill.edu