[comp.lang.ada] Sizes of executables from

tdhammer@wsuiar.uucp (06/09/90)

In article <1700@enea.se>, sommar@enea.se (Erland Sommarskog) writes:
> Michael Feldman (mfeldman@seas.gwu.edu) gives the sizes of some
> "hello world" programs:
>>C   (HP835)     34816
>>Ada (HP835)     86016
>>
>>C   (Sun-3)     32768
>>Ada1(Sun-3)     57344
>>Ada2(Sun-3)    106496
>>Ada3(Sun-3)    139264
> 
> I don't think this is a language issue, but one of operating system.
> Shared libraries is apparently not a standard features on Unix, it
> has been on VMS as long as I have known. I haven't tried a "Hello
> world" on VMS, but it should be less than 10 blocks (= 5120 bytes).
> -- 
> Erland Sommarskog - ENEA Data, Stockholm - sommar@enea.se


Just did a quick compile of Feldman's 4 programs under VAX/VMS Ver 5.2.
Here are the results:

		  Hello, World		   Null Program

C  		    128 blocks		    122 blocks
Ada		      6 blocks		      5 blocks

Very interesting!  (A block is 512 bytes.)  Apparently the sharable
libraries under VMS do make a big difference.  Why the big numbers
with the C code?

I also compiled the hello, world program in Ada using the "bad" :-;
USE-clause.  The executable was also 6 blocks, however, I believe that
VMS only makes allocation in 3-block groups, therefore, there could be
a almost 1536 bytes difference between the two versions.

		Tim .D.
-------------------------------------------------------------------------------
Tim .D. Hammer                         BITNET: TDHAMMER@TWSUVAX
Teaching/Research Assistant            UUCP: (currently no good address)
Computer Science Dept.                 INTERNET: tdhammer@wsuiar.wsu.UKans.EDU
Wichita State University               
Wichita, Ks.  67208-1595               TalkNET: (316)689-3156
-------------------------------------------------------------------------------
"A little learning is a dangerous thing." Alexander Pope

kassover@minerva.crd.ge.com (David Kassover) (06/11/90)

In article <204.2670cec6@wsuiar.uucp> tdhammer@wsuiar.uucp writes:
...
>Just did a quick compile of Feldman's 4 programs under VAX/VMS Ver 5.2.
>Here are the results:
>
>		  Hello, World		   Null Program
>
>C  		    128 blocks		    122 blocks
>Ada		      6 blocks		      5 blocks
>
>Very interesting!  (A block is 512 bytes.)  Apparently the sharable
>libraries under VMS do make a big difference.  Why the big numbers
>with the C code?

just to confuse things a little more:  When you linked the C
program, did you scan the C run time library explicitly, or use
the shareable image for that, too?

Also bear in mind that the VMS linker does "demand-zero
compression" of pages that are known to contain zero, so that
these pages, while part of the address space of the program, do
not appear in the file that contains the executable image.

There are lots of other linker options that can be used to
"optimize" the image.  Some of them have significant effects on
the size of the file that is used to store the image.

>I also compiled the hello, world program in Ada using the "bad" :-;
>USE-clause.  The executable was also 6 blocks, however, I believe that
>VMS only makes allocation in 3-block groups, therefore, there could be
>a almost 1536 bytes difference between the two versions.

File allocation clusters are properties of the volume on which
they are stored, not the language used to create object, nor the
linker option used to create the executable.


Sheesh.  Comparing VMS to other operating systems which may or
may not run on the same hardware is almost as inapropos as
comparing C and Ada.  As if *any* one implementation was the
be-all and cure-all for the universe.


--
David Kassover             "Proper technique helps protect you against
kassover@ra.crd.ge.com	    sharp weapons and dull judges."
kassover@crd.ge.com			F. Collins

pvarner@blackbird.afit.af.mil (Paul A. Varner) (06/11/90)

I am afraid, I started something idiotic here.  I posted sizes of executible
programs compiled using C and Ada as a response to Ted Holden's claim that
part of the reason Ada was bad was because it created huge executible files
for trivial programs (i.e Hello, World!).  I posted the sizes to show that his
claim was ludicrous.  Instead that the size depended on the Compiler not the
language.  I think that this group has shown this point, so I am asking that 
we get back to more important subjects.  BTW Thanks to Prof. Feldman for also
showing this point as well.  

						Paul Varner