Why are binaries/executables so large on Windows?

Jarrett Billingsley kb3ctd2 at yahoo.com
Fri Jul 20 13:38:35 PDT 2007


"rpgfan3233" <rpgfan3233 at gmail.com> wrote in message 
news:f7qlnl$goj$1 at digitalmars.com...
> generates a 75kb executable with dmd 1.018 using the following line:
> dmd -O -release test.d
>
> Does anybody know why this happens? The one thing that prevents me from 
> using D is the large size of the generated files.

The one thing?  The one, single, motivating factor for you to not use D is 
because an empty executable is 70KB?  Unless you're developing for an 
embedded system, or competing in the 64k demo competition, there's no need 
for executables to be very, very small.

This 70KB is largely due to the runtime type info which is included (and 
necessary) for most of the runtime to use.  This also includes the garbage 
collector.

This is pretty much a constant overhead.  You can think of the size of the 
EXE as a line ax + b, where b is 70K and x is the amount of user code.  Have 
you tried building a larger program?  You'll end up with EXEs very similar 
in size to those written in other languages. 





More information about the Digitalmars-d mailing list