From: dmurdoch@mast.queensu.ca (Duncan Murdoch)
Newsgroups: comp.lang.pascal,comp.lang.basic.visual.misc
Subject: Re: [DELPHI]: heavily BLOATED exe files with delphi?????
Date: Tue, 9 May 1995 22:48:06 GMT
Organization: Queen's University

In article <3olo0g$aq0_002@pm1-4.skypoint.net> zeta@skypoint.com (Gregory S. Youngblood) writes:
.

>I knew Borland Pascal was HEAVILY bloated.  A simple "Hello World" program 
>using WinCRT compiled to over 150k with NO functionality other than to start 
>and stop.  After seeing that I didnt try Pascal for writing in Windows again.

I think there was something wrong with your compiler options.  I just compiled 
Hello World in BP 7, targetted for Windows, and got a 54K .EXE.  In Delphi it 
was 24K.

>I figured that since Delphi was "the next generation" Pascal for windows 
>programming so to speak, that they would have gotten their act together and 
>created more compact EXEs.  Oh well.

It does.  It also comes with an .EXE shrinker, which can shrink the .EXE from 
24K to 21K.

Duncan Murdoch

From: hallvard@falcon.no (Hallvard Vassbotn)
Newsgroups: comp.lang.pascal,comp.lang.basic.visual.misc
Subject: Re: [DELPHI]: heavily BLOATED exe files with delphi?????
Date: Wed, 10 May 95 10:37:17 GMT
Organization: Falcon AS, Oslo, Norway

In <3op64q$pq6@ddi2.digital.net> tnomad@digital.net writes:
>>
>>I'll bite.
>>No I haven't. What is W8LOSS.EXE?
>>

>I just tried it - it apparently strips out a bunch of bloat.

Actually, W8LOSS is a kind of diet program for your EXE and DLL files.
It doesn't remove any code at all but optimizes the relocation tables and
block-sizes with in the EXE/DLL file. You can run it on any EXE/DLL file,
not just the ones created by Delphi.

Try to run TDUMP before and after dieting the EXE/DLL file and you will
se what it does. Often the resulting EXE file will be significantly smaller
and load time seems to improve as well. 

The optimization of the relocation table works like this:
Most compilers/linkers create a relocation table entry for each and every
far function call (local or dynamic). W8LOSS changes this to only keep 
one entry for each unique function that is called. Then that address is
used as a linked-list to find the next program address that must be patched.
The end result is that the relocation table usually will become much smaller.

I think this process is documented in Windows Internals by Matt Pietrek.


-- 
 Hallvard Vassbotn  | Falcon AS (a Reuters company) | Without programmers,
 hallvard@falcon.no | Stranden 1, 0250 OSLO, Norway | the world would stop!


