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 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: Gautier Subject: Re: Matrix Multiplication Date: 1999/12/14 Message-ID: <3856C9A1.F89EFD8@maths.unine.ch>#1/1 X-Deja-AN: 560724627 Content-Transfer-Encoding: 7bit References: <385699B5.59C14D03@lmco.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii MIME-Version: 1.0 Newsgroups: comp.lang.ada,comp.lang.fortran Date: 1999-12-14T00:00:00+00:00 List-Id: > OK, > I was challenged by one of my co-workers - a control and guidance type - > not a real software engineer. > > His claim : "Fortran is faster doing floating point multiplication than > Ada" > > I could not get any other specifications such as hardware, particular > compiler, version, vendor, special math libraries or any other > equivocations. Just he > claims the above in all cases. > > So could I get some help getting times for a Matrix inversion on a 50X50 > flotaing point matrix in both languages. Anyone already done these > types of tests? Any sugestions on special libraries that he may not know > about to do such things in Ada. Obviously he has the Fortan side nailed. I have done a comparison, for sparse matrix computations, where matrix multiplications do not depend on library code, so you compare really Ada and Fortran. Compiled on DEC Ada & DEC Fortran, both give almost (some percents) the same timing - even though generic code is used in Ada to match single and double precision, and the Ada code is not optimal. This is an equivalent code comparison. For a large scale numerics project, procedure encapsulation subtyping, exceptions in Ada save a lot of parameter passing, error codes, redimensioning everything everywhere (with errors...) compared to Fortran - this is beside the floating-point part strictly speaking. This has to be proven, but my conjecture is that one can produce Ada code much friendlier with processor cache, hence faster than Fortran. Well-placed "renames" or "inline" pragmas produce astonishing effects, too. > I know it is silly but this is the kind of FUD that gets thown around > all the time. Either language could win - it depends on many of the > above issues. Claims of this sort are never verified and the rule is to compare apples with patatoes... That is the problem with computing (and humans...). Maybe the things were more `visual' in the steam / electricity choices - although... NB: for a fair comparison don't forget to suppress all the standard Ada checkings at compile-time... -- Gautier _____\\________________\_______\ http://members.xoom.com/gdemont/