Path: utzoo!attcan!uunet!aplcen!unmvax!nmt.edu!dwho From: dwho@nmt.edu (David Olix) Newsgroups: comp.lang.c Subject: Re: A study in code optimization in C Summary: Interesting results for VAX... Keywords: memcopy Message-ID: <1990Jul28.231410.25395@nmt.edu> Date: 28 Jul 90 23:14:10 GMT References: <133@smds.UUCP> <1990Jul26.144134.16053@ux1.cso.uiuc.edu> <134@smds.UUCP> Organization: New Mexico Institute of Mining and Technology Lines: 44 In article <134@smds.UUCP> rh@smds.UUCP (Richard Harter) writes: >In article <1990Jul26.144134.16053@ux1.cso.uiuc.edu>, mcdonald@aries.scs.uiuc.edu (Doug McDonald) writes: >> In article <133@smds.UUCP> rh@smds.UUCP (Richard Harter) writes: > >> >The macro shown below is an optimized memory to memory copy macro. >> >It is probably faster than memcopy on your machine -- I have checked >> >it on several machines and have always found it to be faster. >> !!!!!! > >> Oh My!. > > [Superior timings for a 20KB move on a 386 by memmove given] > [Explanation for slower performance on 386 deleted] >In defense I have to point out that the quoted remark is accurate; >timings were made on 680x0 boxes, vaxes (!), and some risc boxes, [...] Just for kicks I did the following test on these machines: Sun 3/280 (68020) running SunOS 4.1, HP 9000/835 (HP Precision Architecture RISC) running HP-UX 7.0, and a VAX 750 running 4.3 BSD (don't laugh, it still runs!) Timings are in seconds based on 1000 copies of a 20K char array. Compile commands were: cc -O and gcc -O -fstrength-reduce -finline-functions. Macro (copy) Library (memcpy) Compiler Sun HP VAX Sun HP VAX cc 7 7 52 3 1 95 <-- gcc 8 --- 51 2 --- 96 Oddly, the macro *DOES* seem to work faster on the VAX (Gee, so I guess all the world *is* a VAX :-) :-) :-) >Richard Harter, Software Maintenance and Development Systems, Inc. >Net address: jjmhome!smds!rh Phone: 508-369-7398 >US Mail: SMDS Inc., PO Box 555, Concord MA 01742 >This sentence no verb. This sentence short. This signature done. --David Olix dwho@{nmtvax|nmtsun|minos}.nmt.edu .sig under construction Any connection between my views and NMIMT's is purely coincidental