www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/12/20:45:50

From: "DeHackEd" <Not DOT given AT out>
References: <Pine DOT SOL DOT 3 DOT 96 DOT 980710150036 DOT 7738B-100000 AT sol DOT sun DOT csd DOT unb DOT ca>
Subject: Re: executable size under DJGPP
Date: Sun, 12 Jul 1998 20:42:56 -0400
Lines: 58
Message-ID: <#odfPdfr9GA.127@upnetnews05>
Newsgroups: comp.os.msdos.djgpp
NNTP-Posting-Host: d14-bn46-blvl-pda.attcanada.net [142.194.137.206]
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

It's in the FAQ,
but let's take a look.

Endlisnis wrote in message ...
> I am just wondering what the expected size ratio is between a
>program compiled under a 16-bit compiler (like BC++3.1) and DJGPP.  I
>remember reading a while ago somebody saying that only 18k was linked into
>every DJGPP file. (I may have the wrong number)  I tried compiling:


There are some functions you can omit to shrink an EXE, not using things like
command-line globing. By default, it's more than 18k (the cmd-line globing is
around 10k itself, + protected mode).
>
>void main(){}
>
> And it came out as 67k.  I tried using <fstream.h>


DPMI memory and protected mode go to waste on this. Compress it using DJP. It's
in v2misc/mlp*b.zip in the FTP sites. It's very good, very fast during
decompression, and almost always averages about 50% size compression (of course
this varies).

>#include<fstream.h>
>
>void main()
>{
> fstream a("test", ios::out|ios::binary);
> a << "Hello";
> }
>
> And it ended up 202k.  From what I remember of BC++v3.1 those
>programs would have compiled to 5k & 29k.  Should I expect 10:1 ratios to
>take care of Protected mode issues?
>

C++ is a little big. The HELLO WORLD program using cout can be well over 200k
depending on your GCC version. DJP can bring it down to 80k or even less.

<Advertising mode off>

As for the ratio, once a function is in your program, it won't get any larger.
If you incorperate more C++ libraries, it will get larger. As George Foot so
succinctly put it, anyone who is concerned
about the ratio between library and program code should just get to work and
write more program code to catch up :-) (Got that from the Allegro DOCS). It
won't change unless you use more library code.

--
"DeHackEd"

My Email address in the header is fake (spammers). Email me at this address:

http://www.geocities.com/cgi-bin/homestead/mail.pl?dehacked



- Raw text -


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