[comp.lang.ada] executable sizes for 4 Ada and 2 C compilers

mfeldman@seas.gwu.edu (Michael Feldman) (06/05/90)

Here are four programs:

with Text_IO;
procedure Hello is
begin
  Text_IO.Put_Line("Hello,world");
end Hello;

#include <stdio.h>
main()
{
   printf("hello, world\n");
}

procedure Simple is
begin
  null;
end Simple;

main()
{
   
}

Here are the executable sizes:

                Hello, world               Null Program

C (HP835)          34816                      16384
Ada (HP835)        86016                      34816

C (Sun-3)          32768                      24576
Ada1 (Sun-3)       57344                      24576
Ada2 (Sun-3)      106496                      32768
Ada3 (Sun-3)      139264                      57344

Clearly, linking in the IO libraries makes a BIG difference. In fact,
you can try other programs and will discover that linking in the IO
libraries creates a BIG constant factor in the size of the executable.
This suggests that compiler writers would do well to optimize their
IO system, if they can, at least to throw out all unused code. Note that
this is NOT an Ada language issue, merely a market issue.
---------------------------------------------------------------------------
Prof. Michael Feldman
Department of Electrical Engineering and Computer Science
The George Washington University
Washington, DC 20052
+1-202-994-5253
mfeldman@seas.gwu.edu
---------------------------------------------------------------------------