comp.lang.ada
 help / color / mirror / Atom feed
From: Hibou57 <yannick_duchene@yahoo.fr>
Subject: Re: Reducing the size of executables produced by GNAT
Date: Wed, 13 Feb 2008 12:03:39 -0800 (PST)
Date: 2008-02-13T12:03:39-08:00	[thread overview]
Message-ID: <9c0a949b-ce82-4eda-99c9-02aace675266@d21g2000prf.googlegroups.com> (raw)
In-Reply-To: 47b300d3$1@news.post.ch

First of all, many thanks for you anwers to all of you :)

On 13 fév, 15:38, Martin Krischik <krisc...@users.sourceforge.net>
wrote:

> Seehttp://en.wikibooks.org/wiki/Ada_Programming/Basic#FAQ:_Why_is_.22Hel...
I saw this one, but when I try to compile the exemple with "gnatmake -
Phello_world", I just get compilation errors. I've removed the options
which turned into error, but then finally the size is the same.

Note: I'm using gcc-ada which comes with MinGW (for Windows XP), and
the last version of gcc-ada from Debian (for an old Linux machine).

> Well, the record is 8kb for Linux-i686-Release.
I would like to get the same :(

> No nessesarily, static linked files are large but might load faster. All
> depends of course. If startup is important then guesswork won't help -
> you have to time it.
Oops, I've sid something wrong : when I was talking about a statically
linked application, I was talking about a staticaly linked GNAT
runtime. Apart of that, there are still dynamics dependencies. So this
is not trully staticaly linked.

> BTW: I hope you use the most powerfully CGI binding available:
My own, which works fine. It is actually written in Pascal
(FreePascal), but I do not want to use it anymore (no more FreePascal,
and no more Pascal).


gautier_niou...@hotmail.com wrote
> Short answer: the fixed cost is big, but if your source grows beyond
> "Hello world", the binary growth is very decent, of course with the
> appropriate options.
Yes, you are right in some way, and I had my self written the same in
a french forum. But the world in not only made of big applications,
and some are small, while beeing still needed.

> Long answer: see newsgroups archives!
Already done, and I did not find anything useful to me.

Pascal Obry wrote :
> Yes and this is called: runtime.
I know what a runtime is, but I do not understand why the one coming
with GAT is so much big even where they are so little needs.

By the way : is there a place where one can find a lightweight
runtime ?

This was what I was looking for first, bu I did not find any at the
time.

> Indeed, debated many many times...
Perhaps, but if every will stop to talk about thing which has already
been talked about, then no body will not talk about anything :p

I was expecting to come into some interesting news.

Ludovic Brenta wrote:
> * compile with -Os (optimize for size)
> * strip the executable maximally
Already done (even tryed witg gnatelim, which by the way seems to be
missing with MinGW).

> Do not worry though that the machine executes 45 KB of instructions.
> Part of the executable contains data, which you cannot reduce but
> which is obviously not executable.
If it is not executed, so can I remove it in some way ?

> want performance, forget GCI. GCI is probably the worst way to do
> dynamic web sites and has been deprecated for the past 10 years or so.
> 120K or 45K or 10K CGI executables won't make a difference because the
> executable files will be in the buffer cache anyway. What does make
> CGI slow is creating a new process with environment variables, file
> descriptors, etc. and then the necessary inter-process communications
> between the web server and the scripts. And CGI does that for each
> incoming HTTP request: this is bad.

> The proper way is to write one executable that embeds the web server
> itself. The Ada Web Server library from AdaCore was designed
> specifically for this purpose.  With AWS, your one executable will be
> larger but much, much faster than CGI. And, since you will not launch
> your application with each HTTP request but only once and leave it
> running all the time, dynamic linking will be an option.

Nice advice indeed, I like this one, beceause I often think about it
(I'd better say, I often dream about it). I will love to be able to do
that, but I'm hosted on a mutualist server (not dedicated), so I have
no other choice excet to rely on the CGI interface.

At the time I'm just able to earn omething like 100$ a moth with this
site, so I cannot paid for a dedicated server, but I would like to
work on some more intereting online applications.

Anon wrote:
> If you rewrite the GNAT RT Libraries system so that it only uses the
> routines that you need with direct OS Interface packages you can get
> a program like "Hello" down to the bare minimum of 256 bytes (1
> sector on a floppy) or less. It is easy to do but for most people that
> too much work.
I do not mind about writing a runtime sweeted to what I need (I will
use syscalls, thus requiring no dynamic linking, fast and small), but
I do not know how to do with the exceptions runtime. I had a look at
this :
http://www.iuma.ulpgc.es/users/jmiranda/gnat-rts/index.htm
but this not goes into enought deep detail about the way GNAT handle
exceptions.

As an exemple, if I attempt to compile with "No_Run_Time", I get an
error about a duplicate symbol which is not documented in this
document.



Pascal Obry wrote:

> You must be very good to be able to develop a full Ada runtime in 256
> bytes! No the problem is more about unused code elimination, this is
> possible on some plate-forms with recent binutils and GCC/GNAT.
Not a full runtime of course, but a runtime with just what is needed
(mainly file I/O, memory allocation and exception support, ... the
latter beeing the one I do not know how to implement)

Tero Koskinen wrote :
> Like others suggested, look at AWS. It is a fast web server, much
> faster than normal http-server + CGI app combination.
As I said before, I would love to do that, but I cannot, due to the
fact that it is not a dedicated server.

> Here is simple example which uses C runtime instead of Ada runtime
> for output:
At the time the trouble is with exceptions

Is there a runtime with just no more than exception support ?


Well, I will have deeper look just at least to compare loading time of
a Pascal vs an Ada (GNAT) application.

If you have any other idea, do not hesitate to tell here

Read you soon friends :)

Yannick Duchêne



  reply	other threads:[~2008-02-13 20:03 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-13 11:52 Reducing the size of executables produced by GNAT Hibou57
2008-02-13 14:38 ` Martin Krischik
2008-02-13 20:03   ` Hibou57 [this message]
2008-02-13 20:25     ` Pascal Obry
2008-02-13 21:41       ` Maciej Sobczak
2008-02-13 23:35         ` Ludovic Brenta
2008-02-13 20:37     ` tmoran
2008-02-14 10:12       ` Georg Bauhaus
2008-02-14 11:07         ` Ludovic Brenta
2008-02-14 22:07           ` Hibou57
2008-02-15  0:19             ` Robert A Duff
2008-02-13 21:27     ` Gautier
2008-02-13 22:14       ` Hibou57
2008-02-14 10:34         ` Georg Bauhaus
2008-02-14 10:53         ` anon
2008-02-15  5:52         ` Randy Brukardt
2008-02-19  0:41           ` Hibou57
2008-02-15  5:52         ` Randy Brukardt
2008-02-15  5:52         ` Randy Brukardt
2008-02-13 14:50 ` gautier_niouzes
2008-02-13 15:41   ` Pascal Obry
2008-02-13 15:52 ` Ludovic Brenta
2008-02-13 16:19 ` anon
2008-02-13 16:28   ` Pascal Obry
2008-02-13 17:34 ` Tero Koskinen
2008-02-13 21:32 ` Jeffrey R. Carter
2008-02-14  6:58 ` Jacob Sparre Andersen
replies disabled

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