Re: Reducing the size of executables produced by GNAT
- From: Hibou57 <yannick_duchene@xxxxxxxx>
- Date: Wed, 13 Feb 2008 12:03:39 -0800 (PST)
First of all, many thanks for you anwers to all of you :)
On 13 fév, 15:38, Martin Krischik <krisc...@xxxxxxxxxxxxxxxxxxxxx>
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. AllOops, I've sid something wrong : when I was talking about a statically
depends of course. If startup is important then guesswork won't help -
you have to time it.
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...@xxxxxxxxxxx wrote
Short answer: the fixed cost is big, but if your source grows beyondYes, you are right in some way, and I had my self written the same in
"Hello world", the binary growth is very decent, of course with the
appropriate options.
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)Already done (even tryed witg gnatelim, which by the way seems to be
* strip the executable maximally
missing with MinGW).
Do not worry though that the machine executes 45 KB of instructions.If it is not executed, so can I remove it in some way ?
Part of the executable contains data, which you cannot reduce but
which is obviously not executable.
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 theI do not mind about writing a runtime sweeted to what I need (I will
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.
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 256Not a full runtime of course, but a runtime with just what is needed
bytes! No the problem is more about unused code elimination, this is
possible on some plate-forms with recent binutils and GCC/GNAT.
(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, muchAs I said before, I would love to do that, but I cannot, due to the
faster than normal http-server + CGI app combination.
fact that it is not a dedicated server.
Here is simple example which uses C runtime instead of Ada runtimeAt the time the trouble is with exceptions
for output:
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
.
- Follow-Ups:
- Re: Reducing the size of executables produced by GNAT
- From: Gautier
- Re: Reducing the size of executables produced by GNAT
- From: tmoran
- Re: Reducing the size of executables produced by GNAT
- From: Pascal Obry
- Re: Reducing the size of executables produced by GNAT
- References:
- Reducing the size of executables produced by GNAT
- From: Hibou57
- Re: Reducing the size of executables produced by GNAT
- From: Martin Krischik
- Reducing the size of executables produced by GNAT
- Prev by Date: Re: Reducing the size of executables produced by GNAT
- Next by Date: Re: Reducing the size of executables produced by GNAT
- Previous by thread: Re: Reducing the size of executables produced by GNAT
- Next by thread: Re: Reducing the size of executables produced by GNAT
- Index(es):
Relevant Pages
|