comp.lang.ada
 help / color / mirror / Atom feed
* binary size (gnat+win console)
@ 2004-08-01 17:45 Andi
  2004-08-01 21:48 ` alwa
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Andi @ 2004-08-01 17:45 UTC (permalink / raw)


hello,

a simple "hello-world" binary takes 219kb after building !?
there are ways for optimizations ??

best regards


---
with Ada.Text_Io;
use Ada.Text_Io;

procedure Hello is
begin
    Put_Line("Hello World");
end Hello;
---




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

* Re: binary size (gnat+win console)
  2004-08-01 17:45 binary size (gnat+win console) Andi
@ 2004-08-01 21:48 ` alwa
  2004-08-01 23:27   ` Andi
  2004-08-01 22:39 ` Adrian Knoth
  2004-08-02  4:21 ` Per Sandberg
  2 siblings, 1 reply; 7+ messages in thread
From: alwa @ 2004-08-01 21:48 UTC (permalink / raw)


Hi Andi,

That's lovely. I builded a hello-world by mingw, That takes 1.2M. 
fortunately, it just 82k after using "strip hello.exe".


Andi wrote:
> hello,
> 
> a simple "hello-world" binary takes 219kb after building !?
> there are ways for optimizations ??
> 
> best regards
> 
> 
> ---
> with Ada.Text_Io;
> use Ada.Text_Io;
> 
> procedure Hello is
> begin
>    Put_Line("Hello World");
> end Hello;
> ---
> 



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

* Re: binary size (gnat+win console)
  2004-08-01 17:45 binary size (gnat+win console) Andi
  2004-08-01 21:48 ` alwa
@ 2004-08-01 22:39 ` Adrian Knoth
  2004-08-02  5:16   ` Ludovic Brenta
  2004-08-02  4:21 ` Per Sandberg
  2 siblings, 1 reply; 7+ messages in thread
From: Adrian Knoth @ 2004-08-01 22:39 UTC (permalink / raw)


Andi <hmail@gmx.net> wrote:

> a simple "hello-world" binary takes 219kb after building!?

Strange.

adi@drcomp:/tmp$ ls -l Hello
-rwxr-xr-x  1 adi users 21193 Aug  2 00:29 Hello
adi@drcomp:/tmp$ strip Hello
adi@drcomp:/tmp$ ls -l Hello
-rwxr-xr-x  1 adi users 7668 Aug  2 00:29 Hello

Compiler is gnat-3.15p with Ludovic's Debian-backports.

But I wouldn't care too much about executable size. I guess
having a more complex application wouldn't raise the size
in a linear way, it's just the usual overhead (constant amount).

-- 
mail: adi@thur.de  	http://adi.thur.de	PGP: v2-key via keyserver

Impotenz:  Mit gekochten Spaghetti Mikado spielen wollen.



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

* Re: binary size (gnat+win console)
  2004-08-01 21:48 ` alwa
@ 2004-08-01 23:27   ` Andi
  0 siblings, 0 replies; 7+ messages in thread
From: Andi @ 2004-08-01 23:27 UTC (permalink / raw)


alwa schrieb:
> Hi Andi,
> 
> That's lovely. I builded a hello-world by mingw, That takes 1.2M. 
> fortunately, it just 82k after using "strip hello.exe".

okay, a strip results in 76kb :)

(compare with 25kb of a "generic" vc++-"hello world" it is not bad... 
but this is beyond the scope ;))

best regards




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

* Re: binary size (gnat+win console)
  2004-08-01 17:45 binary size (gnat+win console) Andi
  2004-08-01 21:48 ` alwa
  2004-08-01 22:39 ` Adrian Knoth
@ 2004-08-02  4:21 ` Per Sandberg
  2004-08-02 13:04   ` Georg Bauhaus
  2 siblings, 1 reply; 7+ messages in thread
From: Per Sandberg @ 2004-08-02  4:21 UTC (permalink / raw)
  To: comp.lang.ada

Hi,
I sounds like you are building with static runtimes and  have debug 
symbols in the executable.
Some months ago i did a test with code sizes for hello_world and using
Ada compiled with GNAT
C compiled with GCC and MS VC++ 6.0
and the size of the executables was about 10K bytes.
I did not looke any further since the sizes from all three compilers was 
about the same when doing the same thing.
* Building with full opimization.
* Use dynamic linked runtimes.
* Dont include debug symbols in the executable.
(This is using GNATPro 5.03w) and i dont remember when dynamic runtimes 
was introduced in GNAT.
 From my experience:
    Most compilers produces executables of comparable sizes (+/- 15%) 
when doing the same thing
       * Linking the same way (Dynamic or static runtimes),
       * Having the same set of runtime checks enabled (Suppress all 
checks when copmparing Ada and C/C++).
       * With or without debug symbols,
       * Same optimsztion settings.
/Per






Andi wrote:

> hello,
>
> a simple "hello-world" binary takes 219kb after building !?
> there are ways for optimizations ??
>
> best regards
>
>
> ---
> with Ada.Text_Io;
> use Ada.Text_Io;
>
> procedure Hello is
> begin
>    Put_Line("Hello World");
> end Hello;
> ---
>
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada-france.org
> http://www.ada-france.org/mailman/listinfo/comp.lang.ada
>



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

* Re: binary size (gnat+win console)
  2004-08-01 22:39 ` Adrian Knoth
@ 2004-08-02  5:16   ` Ludovic Brenta
  0 siblings, 0 replies; 7+ messages in thread
From: Ludovic Brenta @ 2004-08-02  5:16 UTC (permalink / raw)


Adrian Knoth writes:
> Andi wrote:
>
>> a simple "hello-world" binary takes 219kb after building!?
>
> Strange.
>
> ls -l Hello
> -rwxr-xr-x  1 adi users 21193 Aug  2 00:29 Hello
> strip Hello
> ls -l Hello
> -rwxr-xr-x  1 adi users 7668 Aug  2 00:29 Hello
>
> Compiler is gnat-3.15p with Ludovic's Debian-backports.
>
> But I wouldn't care too much about executable size. I guess
> having a more complex application wouldn't raise the size
> in a linear way, it's just the usual overhead (constant amount).

I would suppose that most of the difference comes from linking
statically against libgnat and/or MinGW or Cygwin on Windows.  On
Debian, gnat links dynamically by default.

-- 
Ludovic Brenta.



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

* Re: binary size (gnat+win console)
  2004-08-02  4:21 ` Per Sandberg
@ 2004-08-02 13:04   ` Georg Bauhaus
  0 siblings, 0 replies; 7+ messages in thread
From: Georg Bauhaus @ 2004-08-02 13:04 UTC (permalink / raw)


Per Sandberg <per.sandberg@bredband.net> wrote:
:       * Having the same set of runtime checks enabled (Suppress all 
: checks when copmparing Ada and C/C++).

WRT C++ this isn't entirely fair, I think. There are checked
operations in some frequently used containers. The decision whether
checking is used or not is expressed at the source level, by choosing
the operator/function used to gain access to components.
Not by a choice of compiler switches.


-- Georg



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

end of thread, other threads:[~2004-08-02 13:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-01 17:45 binary size (gnat+win console) Andi
2004-08-01 21:48 ` alwa
2004-08-01 23:27   ` Andi
2004-08-01 22:39 ` Adrian Knoth
2004-08-02  5:16   ` Ludovic Brenta
2004-08-02  4:21 ` Per Sandberg
2004-08-02 13:04   ` Georg Bauhaus

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