delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/26/02:49:25

From: "John M. Aldrich" <fighteerNO AT SPAMcs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: How Come the Executable Files are SO Large?
Date: Fri, 25 Apr 1997 10:46:55 +0000
Organization: Two pounds of chaos and a pinch of salt
Lines: 39
Message-ID: <33608B9F.5D56@SPAMcs.com>
References: <01bc51ee$55eb94e0$030101c0 AT ibm DOT ibm DOT net>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp110.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Don Berkley wrote:
> 
> Hello, I was very excited to learn about DJGPP and
> installed it on one of my DOS machines.  However,
> the executable (.exe) files produced by the compiler
> are roughly twice the size I expect them to be.  Am
> I doing something wrong or why are they so big?
> Thanks for any enlightenment!

This is one of the most frequently asked DJGPP questions.  Why do I say
this?  The Frequently Asked Questions list (v2/faq210b.zip) gives a
detailed explanation of executable size and what you can do about it in
chapter 8.15.

Briefly, the vast majority of that extra space is used by the djgpp
startup code, which handles switching into protected mode, setting up
exception handling and long filename support, parsing the command line
arguments, reading the system environment and 'djgpp.env', and more. 
There are ways to disable some of this; see the aforementioned section
of the FAQ.

The thing to remember about the startup code is that it is a fixed
size:  the larger the program, the less proportional part of it will be
taken up by the startup code.  In fact, for large programs, DJGPP
usually produces code that's smaller and faster than code from any
commercial DOS compiler.  With small programs, the time it takes to
perform the startup operations completely obscures the time it takes to
actually run your code.  It's a bit silly to do all of that work just to
print "Hello, world." on the screen.  ;)

-- 
John M. Aldrich, aka Fighteer I <fighteer AT cs DOT com>

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS d- s+:- a-->? c++>$ U@>++$ p>+ L>++ E>++ W++ N++ o+>++ K? w(---)
O- M-- V? PS+ PE Y+ PGP- t+(-) 5- X- R+(++) tv+() b+++ DI++ D++ G>++
e(*)>++++ h!() !r !y+()
------END GEEK CODE BLOCK------

- Raw text -


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