From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6ff6ac051491e437 X-Google-Attributes: gid103376,public From: davidf@deci.mks.com (David J. Fiander) Subject: Re: GNAT Codesize Date: 1996/06/25 Message-ID: <4qolqi$4nl@deci.mks.com>#1/1 X-Deja-AN: 162066269 references: <31c8fdd4.5a455349@zesi.ruhr.de> <835637893.1349.0@assen.demon.co.uk> organization: Mortice Kern Systems, Inc. newsgroups: comp.lang.ada Date: 1996-06-25T00:00:00+00:00 List-Id: According to John Howard : > >Below are my Turbo Pascal and two GNAT v3.05 results. > >program HelloWorld; >begin > writeln('Hello, world'); >end. > >>tpc hello.pas > >The Borland Turbo Pascal v7.0 produces: >HELLO EXE 2192 6-24-96 7:33p > >The DJGPP version (GNAT v3.05) produces: >HELLO ADB 91 6-24-96 8:21p >HELLO ALI 749 6-24-96 8:39p >HELLO O 519 6-24-96 8:39p >HELLO EXE 83456 6-24-96 8:40p > >The OS/2 version (GNAT v3.05) produces: >HELLO ADB 91 6-24-96 8:21p >HELLO ALI 749 6-24-96 8:22p >HELLO O 237 6-24-96 8:22p >HELLO EXE 263355 6-24-96 8:22p Checking the size on disk is pretty pointless if the file contains debugging symbol tables because no O/S (not even DOS) will load the debugging information into memory. More interesting is the output of the "size" command, which displays the size of the text, data, and bss regions (or their DOS equivalents). with Ada.Text_IO; use Ada; procedure Main is begin Text_IO.Put_Line("Hello, world"); end Main; GNAT 3.05 on Solaris produces: worf=(); size thello 36756t + 708d + 1724d + 4500b = 43688 (aaa8) while the file size is worf=(); ls -l thello -rwxr-xr-x 1 davidf r+d 116904 Jun 21 10:23 thello So, half the disk file is debugging info. Of course, using Gnat_IO: with Gnat.IO; procedure Main is begin Gnat.IO.Put_Line("Hello, world"); end Main; gives me a size of worf=(); size ghello 2888t + 250d + 408d + 2616b = 6162 (1812) Mostly because Gnat.IO doesn't suck in all the exception, finalization, streams, and unused text code that Ada.Text_IO does. - David