Executable size

torhu no at spam.invalid
Sat May 10 12:14:45 PDT 2008


Gregor Richards wrote:
> Robert Fraser wrote:
>> Frank Benoit wrote:
>>> Robert Fraser Wrote:
>>>> Is this compiled all-at-once or with each object compiled separately?
>>>
>>> all-at-once.
>>> Would you expect it, to be a big difference?
>> 
>> In the other direction. Gregor mentioned that if it's compiled 
>> separately a bunch of redundant type information is included. He cited 
>> some library (the old DWT maybe... too lazy to look up the post) that 
>> ballooned from ~5MB to ~17MB when each file was compile separately.
> 
> If you compile them separately, the /library/ will be larger, but 
> resultant /binaries/ will be smaller.

I tried this with my dwt project, using dmd on Windows.  When dwt is 
compiled with oneatatime=yes, my app becomes 1.6 MB.  Without, it's 2.4 
MB.  That's a 50% increase in size.  The library itself is 6.0 MB in 
either case, built with '-O -release'.

When I was still using the old DWT, my app was 1 MB.  Since the old dwt 
was built with bud, all files were compiled at once, so I guess it could 
have been noticably smaller if built one file at a time.



More information about the Digitalmars-d mailing list