comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <dont.bother.mcondic.auntie.spam@[acm.org>
Subject: Re: Ada Compilers
Date: Wed, 22 May 2002 09:52:43 -0400
Date: 2002-05-22T13:52:45+00:00	[thread overview]
Message-ID: <acg7rd$15g$1@nh.pace.co.uk> (raw)
In-Reply-To: afb6d339.0205211331.30124c52@posting.google.com

"Greg Bek" <gab@rational.com> wrote in message
news:afb6d339.0205211331.30124c52@posting.google.com...
> As a compiler vendor I'd just like to echo MDC's comments.
> Don't just use standard benchmarks, use your application or
> portions of it for testing performance.  Benchmarks like
> the PIWG's are not sufficiently sophisticated to properly
> perform timing of null loops etc.
>
Thanks for the echo. Call me "Marin" - everyone else does. :-)

Artificial benchmarks may tell you something but it is *much* better to use
typical segments of your own apps to try to evaluate performance. Some apps
do lots of data motion, others do lots of comparisons, others do specific
kinds of math, etc. Any given compiler might, for example, generate *really*
tight code for linear equations, but generate slow code for data motion.
Vendors can't do everything, so they spend time optimizing particular
aspects of their products & you'll see as a result that perfectly fine
compilers will have considerable variance in what they come up with for
different applications.


> Ada compilers have many advantages over languages like C/C++
> in that the compiler has greater visibility into the rest of
> a user program.  An Ada compiler can automatically inline
> code across multiple levels of subprogram call, C/C++ have
> difficulty doing this as any called subprogram is usually
> compiled into a different object module.  This means that
> C/C++ must perform a call/return where the Ada code may
> have the call/return (and associated prolog/epilog, stack
> check) eliminated.
>
And of course, as every year goes by in the life of a compiler, more and
more optimizations are found. Every day, in every way, they're getting
better and better. :-) The Ada vendors certainly do have advantages over
some other more popular languages because of how well the language was
designed and the information content of the language being so high.


>
> Modern compilers are very good at producing optimized code
> under most circumstances.
>
We should remember to keep this in perspective too. When I was building
avionics systems, extremely aggressive optimization and really compact, fast
code were life-and-death issues for the projects. I use Ada now mostly for
PC-ish applications and performance is not nearly so critical. What matters
then are other sorts of creature comforts. (development tools, libraries,
etc.) The caveat being that when shopping for a compiler, you need to ask
about what is important for the intended project and not necessarily buy an
avionics-quality compiler just because you are obsessed with speed.

Of course, if someone can give me *everything* for *nothing* I'd be really
thrilled. But I won't hold my breath. :-)


> However there are some subtle issues with Ada that can
> prevent getting the best code possible.  The best example
> of this is using controlled objects within your program.
> Controlled types require the compiler to generate invisible
> code that makes sure any objects are properly finalized when
> a scope is exited.
>
If high performance is an issue for your apps, you need to *really*
understand the language or you can generate inefficient code and be
wondering why. You often have to experiment with alternate ways of
accomplishing the same thing to find the one that fools the compiler into
generating the code you want. I recall once dealing with initialization of
some records where expressing it one way caused the compiler to go off
making a bunch of subroutine calls, but doing it another way we got a single
move of a constant in memory. Know the language and experiment!


>
> As always your milage will vary.
>

Absolutely. And don't besmirch compiler X because it doesn't optimize your
code as nicely as compiler Y. It may optimize someone else's code better
and/or there is a good chance you don't know what you're talking about. :-)

MDC
--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com





  parent reply	other threads:[~2002-05-22 13:52 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-15 18:55 Ada Compilers David Rasmussen
2002-05-15 19:32 ` Marin David Condic
2002-05-15 20:45 ` Jacob Sparre Andersen
2002-05-15 21:00   ` Marin David Condic
2002-05-15 21:38   ` Pascal Obry
2002-05-15 22:35     ` Kai Schuelke
2002-05-16 10:27       ` Preben Randhol
2002-05-16 10:37       ` Dmitry A. Kazakov
2002-05-16 13:51         ` Martin Dowie
2002-05-16 15:06       ` Ted Dennison
2002-05-17  1:22         ` Robert Dewar
2002-05-17 14:56           ` Ted Dennison
2002-05-17  1:23         ` Robert Dewar
2002-05-16 16:59       ` Pascal Obry
2002-05-16 18:50         ` Kai Schuelke
2002-05-17  1:19           ` Robert Dewar
2002-05-17 13:38         ` [off-topic] "free" Wes Groleau
2002-05-17 14:51           ` Preben Randhol
2002-05-16 15:03   ` Ada Compilers Fraser Wilson
2002-05-16 15:19     ` Florian Weimer
2002-05-16  1:07 ` Florian Weimer
2002-05-16 13:16   ` Marin David Condic
2002-05-17 22:12     ` David Rasmussen
2002-05-19 21:14       ` Jacob Sparre Andersen
2002-05-20 13:28       ` Marin David Condic
2002-05-21 21:31         ` Greg Bek
2002-05-22  1:47           ` Robert Dewar
2002-05-22 13:52           ` Marin David Condic [this message]
2002-05-23 11:01             ` John R. Strohm
2002-05-23 13:29               ` Marin David Condic
2002-05-23 15:50               ` Ted Dennison
2002-05-23 16:39               ` Larry Kilgallen
2002-05-16  2:09 ` Steve Doiel
2002-05-16 10:33 ` Preben Randhol
2002-05-16 10:34   ` Preben Randhol
2002-05-16 11:25   ` David Rasmussen
2002-05-16 12:31     ` Preben Randhol
2002-05-16 13:25       ` David Rasmussen
2002-05-16 13:42         ` Steve Doiel
2002-05-16 14:37           ` David Rasmussen
2002-05-16 19:12         ` Preben Randhol
2002-05-17 15:08         ` Ted Dennison
2002-05-16 13:30       ` Marin David Condic
2002-05-17  8:51         ` Preben Randhol
2002-05-16 17:03   ` Pascal Obry
2002-05-17 15:11     ` Ted Dennison
2002-05-17 16:25       ` Pascal Obry
2002-05-18  7:07         ` Simon Wright
2002-05-18  7:57           ` Pascal Obry
2002-05-19  2:50         ` David Botton
2002-05-17 17:40       ` Preben Randhol
2002-05-18 10:44       ` Jerry van Dijk
2002-05-20 16:55         ` Ted Dennison
2002-05-20 18:47           ` Jerry van Dijk
  -- strict thread matches above, loose matches on Subject: below --
2012-11-24 15:55 Ada compilers arkavae
2012-11-24 18:56 ` Niklas Holsti
2012-11-24 18:57 ` Gautier write-only
2005-06-03 18:55 ADA compilers Patty
2005-06-03 19:04 ` Pascal Obry
2005-06-03 19:12 ` Patty
2005-06-03 19:21   ` Dmitry A. Kazakov
2005-06-03 20:37     ` Björn Lundin
2005-06-03 20:25   ` Jeff C
2005-06-03 20:31   ` Keith Thompson
2005-06-03 20:36   ` Björn Lundin
2005-06-04  5:29   ` Jeffrey Carter
2005-06-04  6:32 ` Martin Krischik
2002-05-20 17:39 Ada Compilers David Humphris
     [not found] <mailman.1021886521.4259.comp.lang.ada@ada.eu.org>
2002-05-20 16:46 ` Ted Dennison
1997-11-13  0:00 Nathan A. Barclay
1997-11-13  0:00 ` bklungle
1996-06-16  0:00 ADA Compilers A REILLY
1996-06-18  0:00 ` Jon S Anthony
1993-03-14 12:34 Ada Compilers David Leslie Garrard
1991-04-19 15:22 ADA COMPILERS douglassalter@ajpo.sei.cmu.edu,
1990-01-17 18:49 ADA compilers John Ostlund
1989-11-15 23:18 Ada Promises Doug Schmidt
1989-11-16 22:45 ` Ada compilers William Thomas Wolfe, 2847 
     [not found] <1989Sep <3161@amelia.nas.nasa.gov>
1989-09-29 13:47 ` Ada Compilers Robert Cousins
1989-09-15 20:35 Kelvin W. Edwards
1989-04-11 17:01 ada compilers Kjartan R. Gudmundsson
replies disabled

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