From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,99a6311c4195e21b X-Google-Attributes: gid103376,public X-Google-Thread: 1094ba,99a6311c4195e21b X-Google-Attributes: gid1094ba,public From: Ted Dennison Subject: Re: Matrix Multiplication Date: 1999/12/15 Message-ID: <8390te$ksp$1@nnrp1.deja.com>#1/1 X-Deja-AN: 561097650 References: <385699B5.59C14D03@lmco.com> <838koc$b6d$1@nnrp1.deja.com> <3857E220.26AE90BB@lanl.gov> X-Http-Proxy: 1.0 x22.deja.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Wed Dec 15 21:24:05 1999 GMT X-MyDeja-Info: XMYDJUIDtedennison Newsgroups: comp.lang.ada,comp.lang.fortran X-Http-User-Agent: Mozilla/4.6 [en] (WinNT; I) Date: 1999-12-15T00:00:00+00:00 List-Id: In article <3857E220.26AE90BB@lanl.gov>, "William B. Clodius" wrote: > numerics question where the types are determined statically and > generally map to the equivalent hardware operations. In this case a > common performance difference between languages is the extent to which > the language can rely on local analyses for its optimizations, which > in turn mostly depends on the aliasing properties of entities in the > language, which in turn is most strongly influenced by the properties > of the arguments to procedures. In this case Ada has relatively loose > rules compared to some other languages, e.g., C/C++, but stronger > rules than Fortran, so that Ada is in principle harder to optimize > than Fortran. However, the difference between Fortran and Ada in this That is a fairly accurate principle. So why did I end up finding so many "Ada could do better situations"? You may ask. Well there are two issues you missed in the above: 1) In general, the more information a compiler has about the possible values of objects, the better it can optimize. That gives strongly typed languages an advantage. You may turn off the runtime checking, but the compiler can still assume the values will never exceed that range for code generation purposes. For instance, a big issue is how much information about the possible values of the iteration variables the compiler has access to. The ability of an Ada developer to constrain his index types using subtypes potentially gives the compiler a trememdous boost here. 2) You ignore non-local optimization issues. That's fair enough. But in their quest for more speed, researchers are delving into non-local optimizations. Ada's strong typing drasticly reduces the possible access paths the optimizer has to worry about for a location or value. Also, a lot of the language was written to allow compilers leeway in optimizing. For example, users aren't allowed to make assumptions about the parameter passing method used for subroutines except in certain situations. Generally the more information and freedom a compiler has at its disposal, the easier it will be for it to optimize. > regard is small enough that it might be washed out in the noise of > variations in efficiency of compiler implementations. That's the big point, and we are in complete agreement here. -- T.E.D. Sent via Deja.com http://www.deja.com/ Before you buy.