why simple hello world binary is ~700KB

Jascha Wetzel firstname at mainia.de
Fri Oct 5 08:51:06 PDT 2007


Bedros Hanounik wrote:
> why when I compile this program under gdc I get 697KB of binary and when I compile similar C code in gcc I get 6.5KB (both under Linux (GCC) 4.1.2 20070214 (  (gdc 0.24, using dmd 1.020))

The comparison isn't quite fair, since the D executable contains a lot 
more than the C exe does.
To get a more realistic comparison, compile a C++ version (using 
iostream) with statically linked runtime and RTTI enabled. Using VC8 
(default release settings, plus /MT for statically linked runtime) that 
results in an exe size of 108kb, which is comparable to the 113kb that 
DMD 1.021 produces.



More information about the Digitalmars-d mailing list