comp.lang.ada
 help / color / mirror / Atom feed
From: eachus@mitre-bedford.arpa  (Robert I. Eachus)
Subject: Re: ADA Performance
Date: 3 May 93 21:21:10 GMT	[thread overview]
Message-ID: <EACHUS.93May3162110@spectre.mitre.org> (raw)

     I'd like to go a little further than Robert Dewar and say that
this test violates several important principles about interlanguage
benchmarking.  The first and most important is that you must compare
two versions of the SAME program with the same data.  The difference
in the data I'll assume was a typo, but the difference in programs is
major.  All the Ada versions except case8 and case9 start the timed
loop with a function call, while the FORTRAN version starts with a
static value.  On most compilers I know of this is enough to defeat
movement of code out of the loop...

    Second, use the same clock!  Wall clock time is okay, but know
what you are doing and use a dedicated machine.  (A dedicated machine
is usually needed for other reasons...)  Usually when comparing two
programming languages you either have to do some implementation
dependent coding to get to the same OS clock call, or time the
execution time for the entire benchmark in the OS environment, such as
the Unix "time;test_program;time".

    Third use each the features of each language as they are expected
to be used.  If you are benchmarking FORTRAN 77 vs. Ada 83, the Ada
program should use (user defined) vector operations instead of loops
in the main program and multiple calls to user written subroutines.
(If the comparison is to FORTRAN 90, then both programs should use
vector operations...)

     I won't write and run such a version because of the other
problems with this benchmark, but it is relatively easy:

     type Complex is private;
     type Complex_Vector is array (Integer range <>) of Complex;
     ...
     function "*"(L,R: Complex_Vector) return Complex;
     ...

     Now a good Ada compiler will do pretty well, since it can keep
everything except the big vectors in registers.  Of course, a good
FORTRAN 90 compiler will skip 99 interations of the outer loop. :-)

--

					Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...

             reply	other threads:[~1993-05-03 21:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-05-03 21:21 Robert I. Eachus [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-05-04 19:31 ADA Performance Robert I. Eachus
1993-05-04 15:18 Boris Pelakh
1993-05-04 15:03 cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!howland.
1993-05-03 11:54 cis.ohio-state.edu!news.sei.cmu.edu!firth
1993-04-30 17:18 ADA performance Wes Groleau X7574
1993-04-29 17:08 ADA Performance Jeffrey M. Creem x5700
1993-04-29 16:12 Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox