comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: Code size of Ada ? was Re: Ada95 Strengths/Weaknesses.
Date: 1999/09/30
Date: 1999-09-30T00:00:00+00:00	[thread overview]
Message-ID: <7svnuk$uf8$1@nnrp1.deja.com> (raw)
In-Reply-To: 37F343A5.A68B8321@icn.siemens.de

In article <37F343A5.A68B8321@icn.siemens.de>,
  Alfred Hilscher <Alfred.Hilscher@icn.siemens.de> wrote:
> This is absolutely wrong. OK, you don't like the "Hello
> world", so let me show an other example. I've wrote a simple
> WEB-server
> for remote control of production maschines. The code that GNAT
> produces was more than 800K, the same with Modula was about
> 70K (10% !), both on WinNT.

Are you sure you measured code size, and not executable size,
or do you think they are the same? Of course they are not. If
you don't know why, you need to find out (most likely you
were comparing a stripped program with a non-stripped program,
if you don't know what stripping is about, you need to find
out!)

> Oh, sorry, I remember, you don't
> like comparison with other languages.

That is invented and wrong. I think comparisons with other
languages can be instructive IF DONE RIGHT!

> Well, I compiled the same
> with ObjectAda 7.1 and the total amout of code (with static
linking)
> was 200K. Therefore I think, that there must be a way to
produce
> smaller EXE-files with GNAT, too.

Now you make it clear that you think that the EXE file contains
only code. THis is a severe misconception.

> And _this_ was the question of
> my original posting. Ok, ok. I understand. I do not pay lots
> of $$$ for support, therefore I will not be told the
> neccessary compileroptions <g>.

You could try reading the documentation. I know that this
seems an amazing idea for most people these days, but you
would be surprised how helpful this can be. All the options
are clearly stated in the documentation, you don't need
to pay $$$ for support to find that out.

> But it does not matter, I prefer the Aonix
> tool anyway.

Fine, but I wonder from the above whether you are giving either
tool a real chance if you don't read the documentation to find
out the basic capabilities of the tools.

> > As I said earlier, the comparison figures are pretty useless
> > you cannot generalize from them in this way.

> But a few programs ranging from
> 4 lines up to 5000 should be a little representative.

Not if you make fundamental methodology mistakes, like
assuming that EXE size is the same as code size.

> > But you only did it with small programs ... and almost
> > certainly non-comparable programs at that ...

> NO. See above. Please tell me _your_ definition of "small
> programms".

Well of course this is a bit irrelevant, since it is clear
that your methodology is fatally flawed in two respects:

1. You are assuming that EXE file size is a measure of code
   size. This is true only under careful controlled conditions,
   which you have not established.

2. You are not using appropriate options (see GNAT and GCC
   documentation) to minimize executable size.

It's always interesting to figure out what the default options
should be for a compiler. We seriously considered making -O2
the default, just to deal with the case of people who did
comparisons without the foggiest idea of what they were doing
(reviewers can often be in this category for example). Deciding
whether the run time library should by default be stripped is
another such decision point.

But ultimately we decided to choose the options in a manner
appropriate to those who know what they are doing, and in a
manner consistent with other gcc compilers. This inevitably
leads to the kind of confused thinking that I am responding
to here, but there is no way to get the defaults right for
everyone, you really have to count on people reading the
documentation and taking the effort to be come minimally
aware of what is going on.

I know this sounds a bit harsh and dismissive, but there really
is no substitute for careful reading of the documentation. In
particular, posting a brief message to CLA asking for help can
often be worse than useless for two reasons:

1. There is often insufficient information given to figure out
what the real problem is, so suggested solutions are to some
other problem.

2. The blind leading the blind phenomenon. THere are a lot of
posts to CLA that just give plain wrong, or more commonly
incomplete information. If you ask a question for example
about a particular GNAT option, you are quite likely to be
answered by someone who also has not thoroughly read the
documentation and therefore answers with incomplete knowledge.

A note here: if you have a GNAT-specific question, you will
almost always do better on the chat@gnat.com list. There you
will find a lot of GNAT knowledgable folk who have given up
reading CLA a long time ago (excessive noise to signal ratio :-)
This does not mean that the above two problems do not exist
there too, but you definitely will have a better shot. Still,
there is a furniture store in NY whose motto is "An educated
consumer is our best customer", and that applies here too. The
more effort you make to learn about what is going on, in
particular by thoroughly reading the documentation, the better
off you will be.

It is indicative of the problem that it is quite rare to see
questions about the documentatation itself (what does it mean
when it says bla bla bla). This is surprising, because surely
the documenation is not perfect, and there must be parts that
are not 100% clear.

By the way, some people do read the documentation closely, and
provide useful feedback by reporting errors, unclear stuff,
omissions etc to report@gnat.com. Thanks to all who have helped
in this way in the past, and thanks in advance to those who
can help in the future to improve the documenation in this
manner.

Robert Dewar
Ada Core Technologies

P.S. Alfred, obviously there are some major issues like
stripping, and compilation options to be addressed, but
I suspect we will arrive back at the point of comparability
of code. It would be quite helpful if you would respond to
an earlier suggestion I made and post just a single

C function
Ada subprogram

that you consider comparable. That way we have a specific
example to discuss. Such a discussion could be considerably
more helpful than the general thread so far. The code size
of a program is closely related to the code size of the
individual components ...



Sent via Deja.com http://www.deja.com/
Before you buy.




  parent reply	other threads:[~1999-09-30  0:00 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-27  0:00 Ada95 Strengths/Weaknesses the middleman
1999-09-27  0:00 ` David Starner
1999-09-28  0:00   ` Robert Dewar
1999-09-28  0:00     ` David Starner
1999-09-29  0:00       ` Robert A Duff
1999-09-28  0:00     ` David Starner
1999-09-28  0:00       ` Robert Dewar
1999-09-28  0:00         ` Ray Blaak
1999-09-28  0:00   ` Robert Dewar
1999-09-28  0:00     ` David Starner
1999-09-28  0:00       ` Robert Dewar
1999-09-28  0:00         ` David Starner
1999-09-29  0:00           ` Robert Dewar
1999-09-30  0:00         ` Pragma (was Re: Ada95 Strengths/Weaknesses.) Preben Randhol
1999-09-30  0:00           ` Preben Randhol
1999-09-28  0:00       ` Ada95 Strengths/Weaknesses Robert Dewar
1999-09-28  0:00       ` Ted Dennison
1999-09-28  0:00         ` Simon Wright
1999-09-28  0:00       ` Gautier
1999-09-28  0:00         ` Ed Falis
1999-09-28  0:00           ` David Starner
1999-09-29  0:00           ` Robert Dewar
1999-09-28  0:00         ` David Starner
1999-09-29  0:00           ` Robert Dewar
1999-09-28  0:00       ` p.obry
1999-09-28  0:00         ` David Starner
1999-09-28  0:00           ` Richard D Riehle
1999-09-28  0:00     ` GNAT listing file default names (was: Ada95 Strengths/Weaknesses) Larry Kilgallen
1999-09-28  0:00       ` Gautier
1999-09-29  0:00         ` Robert Dewar
1999-09-29  0:00       ` Robert Dewar
1999-09-29  0:00         ` Larry Kilgallen
1999-09-29  0:00           ` Robert Dewar
1999-09-29  0:00             ` Larry Kilgallen
1999-09-30  0:00               ` Robert Dewar
1999-09-28  0:00     ` Code size of Ada ? was Re: Ada95 Strengths/Weaknesses Alfred Hilscher
1999-09-28  0:00       ` Gautier
1999-09-28  0:00       ` David Botton
1999-09-29  0:00       ` Robert Dewar
1999-09-29  0:00         ` Larry Kilgallen
1999-09-29  0:00           ` Alfred Hilscher
1999-09-29  0:00             ` Ted Dennison
1999-09-29  0:00             ` Robert Dewar
1999-09-30  0:00               ` Alfred Hilscher
1999-09-30  0:00                 ` Gautier
1999-09-30  0:00                   ` Robert Dewar
1999-09-30  0:00                   ` Robert Dewar
1999-09-30  0:00                   ` Robert Dewar
1999-09-30  0:00                 ` Robert Dewar
1999-09-30  0:00                   ` tmoran
1999-09-30  0:00                   ` Ehud Lamm
1999-09-30  0:00                     ` Robert Dewar
     [not found]                       ` <7t2e1l$lqt2@ftp.kvaerner.com>
     [not found]                         ` <37F91D6E.58685CFE@mitre.org>
     [not found]                           ` <7tf7uo$h2b$1@nnrp1.deja.com>
     [not found]                             ` <37FBA978.A86762F1@mitre.org>
1999-10-18  0:00                               ` Robert Dewar
1999-10-19  0:00                                 ` Code size of Ada ? Robert I. Eachus
     [not found]                           ` <7tf7uo <37FBA978.A86762F1@mitre.org>
     [not found]                             ` <5OkO3.2$1e.659@typhoon.nyu.edu>
1999-10-19  0:00                               ` Code size of Ada ? was Re: Ada95 Strengths/Weaknesses Robert I. Eachus
1999-09-29  0:00             ` Gautier
1999-09-29  0:00               ` Ed Falis
1999-09-29  0:00                 ` tmoran
1999-09-29  0:00                 ` Gautier
1999-09-30  0:00               ` Robert Dewar
1999-09-29  0:00           ` Robert Dewar
1999-09-29  0:00           ` Robert Dewar
1999-09-29  0:00         ` Alfred Hilscher
1999-09-29  0:00           ` Robert Dewar
1999-09-30  0:00             ` Alfred Hilscher
1999-09-30  0:00               ` Gautier
1999-09-30  0:00               ` Robert Dewar [this message]
1999-09-28  0:00   ` the middleman
1999-09-27  0:00 ` Marin David Condic
1999-09-27  0:00   ` Hyman Rosen
1999-09-28  0:00     ` Robert Dewar
1999-09-28  0:00       ` Preben Randhol
1999-09-28  0:00         ` bill
1999-09-27  0:00           ` Aidan Skinner
1999-09-28  0:00           ` Larry Kilgallen
1999-09-28  0:00           ` Steve Doiel
1999-09-28  0:00           ` Preben Randhol
1999-09-28  0:00     ` Ed Falis
1999-09-28  0:00       ` Hyman Rosen
1999-09-28  0:00         ` Ed Falis
1999-09-28  0:00   ` Preben Randhol
1999-09-27  0:00 ` J. David Bryan
1999-09-27  0:00 ` Steve Doiel
1999-09-28  0:00 ` Geoff Bull
1999-09-28  0:00 ` Geoff Bull
1999-09-29  0:00   ` the middleman
1999-09-29  0:00     ` Robert A Duff
replies disabled

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