www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/03/28/09:49:55

Date: Thu, 28 Mar 1996 16:37:28 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: bonni mierzejewska <u6ed4 AT wvnvm DOT wvnet DOT edu>
Cc: djgpp AT delorie DOT com
Subject: Re: Exe size
In-Reply-To: <31595fc0.4803520@wvnvm.wvnet.edu>
Message-Id: <Pine.SUN.3.91.960328162918.7145F-100000@is>
Mime-Version: 1.0

On Wed, 27 Mar 1996, bonni mierzejewska wrote:

> I'm too new to DOS to know why a programme compiled with a 32-bit compiler
> is always bigger than the same programme compiled with a 16-bit compiler.

First, don't forget to run `strip' on your program (or link with -s), or 
else you get debugging info/symbols with the GCC executable.  Second, I
think many 32-bit opcodes are longer than their 16-bit brethren.  Third, 
last time I checked BCC (16-bit) and GCC produced very similar sizes of 
executables for a non-trivial program, the above gotchas notwithstanding 
(I *did* remember to strip, though).  Last, but not least, the DJGPP C 
library is much more powerful than the one that comes with BCC.  For 
example, the DJGPP's `rename' function can move entire directories.  This 
functionality comes for a price of larger code, which every program gets 
even if it doesn't need those features.

Oh, and don't use -O3 unless you absolutely need it (profile before you 
decide): it bloats the executable but in most cases doesn't gain you 
anything runtime-wise.  In fact, in many cases I saw decrease in speed.  
-O2 is more than enough in most cases.

- Raw text -


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