comp.lang.ada
 help / color / mirror / Atom feed
* Re: Ada and Number Crunching ?
       [not found] ` <VLADIMIR.95Feb20234429@speedy.intrepid.com>
@ 1995-02-24 11:27   ` sxc
  1995-02-24 17:03     ` Norman H. Cohen
  0 siblings, 1 reply; 2+ messages in thread
From: sxc @ 1995-02-24 11:27 UTC (permalink / raw)


In article <VLADIMIR.95Feb20234429@speedy.intrepid.com>,
Vladimir Vukicevic <vladimir@speedy.intrepid.com> wrote:
>
>As regarding code speed, I'm currently writing a ray tracer completely
>in Ada 95. (Will take full advantage of tasking [as soon as I get that
>pthreads working for linux..] as well as distributed processing, etc.)
>The code runs at about the same speed than a similar ray tracer
>written completely in C++. However, considering that the ada compiler
>in question is gnat, and the C++ compiler is g++, this isn't much of a
>statistic, since they both use the same optimization engine and back
>end (gcc's). :-)

Actually, I think that Vladimir has an interesting point

  Approximately equivalent Ada and C++ programs, when compiled with 
  compilers that use the same backend / optimiser technology, seem
  to run in approximately the same time. 

Now if there was some way to remove some of the hand-waves in the 
above, he may be able to arrive at a meaningful datapoint.  For 
example:

  1)  Are the Ada and C++ programs really comparable; i.e. they do 
  they use the same algorithms and data structures, and have they 
  had similar tuning effort expended on them?

  2)  Are the back-end optimisers really identical?  (Do they do
  any C++ or Ada specific optimisation?)

  3)  What are the actual runtimes?  (Are they dominated by CPU time?)

-- Steve



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Ada and Number Crunching ?
  1995-02-24 11:27   ` Ada and Number Crunching ? sxc
@ 1995-02-24 17:03     ` Norman H. Cohen
  0 siblings, 0 replies; 2+ messages in thread
From: Norman H. Cohen @ 1995-02-24 17:03 UTC (permalink / raw)


In article <3ikfqg$6ar@fang.dsto.gov.au>, sxc@itd.dsto.gov.au writes: 

|> Actually, I think that Vladimir has an interesting point
|>
|>   Approximately equivalent Ada and C++ programs, when compiled with
|>   compilers that use the same backend / optimiser technology, seem
|>   to run in approximately the same time.
|>
|> Now if there was some way to remove some of the hand-waves in the
|> above, he may be able to arrive at a meaningful datapoint.  For
|> example: 
...
|>   2)  Are the back-end optimisers really identical?  (Do they do
|>   any C++ or Ada specific optimisation?)

Ada provides opportunities for optimization that C++ does not, including: 

   o Better aliasing information.  If an untagged Ada global variable is
     not marked "aliased", assignment to X.all, where access value X
     points to the same type, cannot possibly kill the global variable,
     and vice versa.

   o Information provided by constraints.  This can be effectively
     exploited to eliminate redundant constraint checks.  (In C++, if
     constraint checking is performed, it is done by explicit
     programming, and the compiler may be unable to deduce that a check
     is unnecessary because a redundant check was performed earlier.  If
     a C++ program does not perform run-time checking, the only fair
     comparison is with an Ada program compiled with checks suppressed,
     in which case Ada constraint information may still provide an
     advantage, but not as big an advantage.)

Optimizing back ends used for multiple languages typically rely on the
front end to provide aliasing information.  My understanding is that the
gcc back end also has a hook for the front end to provide range
information.  Does gnat provide this information to the back end, and
does the back end exploit it effectively?

--
Norman H. Cohen    ncohen@watson.ibm.com



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1995-02-24 17:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <3iatre$3t1m@lamar.ColoState.EDU>
     [not found] ` <VLADIMIR.95Feb20234429@speedy.intrepid.com>
1995-02-24 11:27   ` Ada and Number Crunching ? sxc
1995-02-24 17:03     ` Norman H. Cohen

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