www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/06/09/19:02:41

From: fredex AT fcshome DOT stoneham DOT ma DOT us
Message-Id: <199606092200.SAA01123@fcshome.stoneham.ma.us>
Subject: Re: Why are they so fat?
To: djgpp AT delorie DOT com
Date: Sun, 9 Jun 1996 18:00:14 -0400 (EDT)
In-Reply-To: <Pine.SUN.3.91.960609165200.342V-100000@is> from "Eli Zaretskii" at Jun 9, 96 04:59:30 pm

Thinking furiously, Eli Zaretskii wrote:
> On 7 Jun 1996, Martin Krieger wrote:
> > #include <iostream.h>
> > int main()
> > {
> >   cout << "Hallo, Welt!\n";
> > }
> > 
> > compiles to 
> > 
> > TEST.EXE   158.101   07.06.96 23:21
> > 
> > Why is this nice little program so extremly huge? Is there a way to shrink
> > it? (Any plans for optimizing linkers like that one Borland Pascal has?)
> 
> Are you *really* interested in the size of a toy program like that?  Most 
> of the overhead is *additive*, so it stays almost constant for much 
> larger programs.  In other words, a 1MB-long program also gets a few tens 
> of KB as an overhead of the startup code and the low-level library 
> functions.

While toy programs are vastly larger than the same thing compiled
with TC/BC/MSC, a real program of significant size tends not to be.
For example, I've built the latest beta Elvis (2.0p beta) with both
MSC 5.1 (large model) and with DJGPP, and find the DJGPP executable
to be slightly SMALLER than the MSC one:

-rwxr-xr-x   1 root     root       298575 Jun  8 18:51 elvis.exe  <=== MSC
-rwxr-xr-x   1 root     root       285184 Jun  8 20:43 elvis.exe  <=== DJGPP

Now, I realize that MSC 5.1 is rather long of tooth, but hey, it's
paid for!

And the program compiled with DJGPP is visibly faster [how does one
do performance benchmarks on an editor?? :-] as long as -O2 is used.

Fred
-- 
-------------------------------------------------------------------------------
 .----    Fred Smith    /                        Office: fred AT computrition DOT com 
( /__  ,__.   __   __ /  __   : /                                 508-663-2524 
 /    /  /   /__) /  /  /__) .+'           Home: fredex AT fcshome DOT stoneham DOT ma DOT us 
/    /  (__ (___ (__(_ (___ / :__                                 617-438-5471 
-------------------------------- Jude 1:24,25 ---------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019