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

   I had said:

   >>    ...The first and most important is that you must compare two
   >> versions of the SAME program with the same data.

   And later I said...

   >>    Third use each the features of each language as they are expected
   >> to be used...

In article <1993May4.080922.22901@lth.se> dag@control.lth.se (Dag Bruck) writes
:

   > You either have to compare compilers with programs that are as similar
   > as possible, or compare languages by writing "idiomatic" code in each
   > language.  I think both kinds of comparisons are useful and complement
   > each other.

   Not a contradiction, just a fundamental problem with cross-language
benchmarking.  First you need two programs which accomplish the same
functional operations in the same order but are written in different
languages.  Second (or third :-) the should be written to take
advantage of the features of the language, not to avoid otherwise
normal operations.  For a good example assume I decide to use a 1024
point Fourier Tranform as a benchmark.  Okay, I should use the same
algorithm for both languages (assume FFT).  If I am going to use a
complex transform in FORTRAN I shouldn't do the transform modulo a
large integer in Ada.  I should use the same input data, read from the
same file, etc., etc.  But the Ada code might be much more elegently
written as a set of recursive calls using vector operations...as long
as I use the same algorithm to get the same answers.  (With reals they
may not be exact, but they should be very close.  In this case I
actually perfer to do the transform and the inverse and measure the
error...)

   On theother hand, if I want to the sum of the first 1,234,567
integers to benchmark Ada vs APL, I have an insoluble problem.  In APL
I will write:
       
       N <-- +/iota 1234567  

    and be very surprised to get anything other than an instant
response.  (All APL systems I know of use a compact representation for
such vectors, and compute the sum from the three numbers actually
generated.)  What is the equivalent code in Ada or FORTRAN?  Writing
an explict loop is probably wrong, and writing (X * (X+1)) / 2 is
worse.  So this particular benchmark is inappropriate for comparing
these languages.

    This was the problem with the benchmark proposed in the article
that started all this.  A truly agressive FORTRAN compiler can get rid
of almost everything, while no sensible Ada compiler is going to try
to determine, at at compile time, whether or not an exception is going
to be raised.  Put in vectors which contain many different values, and
rotate the vectors so that you get 100 different answers, print all of
the answers out, and you might get a valid benchmark.
--

					Robert I. Eachus

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

             reply	other threads:[~1993-05-04 19:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-05-04 19:31 Robert I. Eachus [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-05-04 15:18 ADA Performance Boris Pelakh
1993-05-04 15:03 cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!howland.
1993-05-03 21:21 Robert I. Eachus
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