Path: utzoo!mnetor!uunet!husc6!tut.cis.ohio-state.edu!morganucodon.cis.ohio-state.edu!paul From: paul@morganucodon.cis.ohio-state.edu (Paul Placeway) Newsgroups: comp.sys.mac.programmer Subject: Re: Is my Mac II really slow? Message-ID: <10382@tut.cis.ohio-state.edu> Date: 12 Apr 88 21:41:10 GMT References: <11541@duke.cs.duke.edu> Sender: news@tut.cis.ohio-state.edu Organization: The Ohio State University Dept of Computer and Information Science Lines: 24 Keywords: Mac II, floating point, benchmarks < extended dot(x1,y1,z1,x2,y2,z2) < { return(x1*x2+y1*y2+z1*z2);} In addition to the Mac-specific floating-point advice, you could probably get a reasonable speadup on all of the machines (depending on the smartness of the respective compilers) by replacing this with: #define DOT(x1,y1,z1,x2,y2,z2) (x1*x2+y1*y2+z1*z2) This will eliminate the overhead of a function call with 6 arguments on the stack (usually compairable in speed to several FLOPS) , and will allow you to declare the variables as register (as long as the compiler understands what a "register double" is). A really good compiler should turn this into code that is about as good as tuned (straight-forwared) assembly code (including exploiting 68881 register values). Of course, your milage may vary... -- Paul -=- Existence is beyond the power of words To define: Terms may be used But are none of them absolute.