Huge output size for simple programs

John Colvin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Sep 11 05:31:43 PDT 2015


On Friday, 11 September 2015 at 11:15:33 UTC, NX wrote:
> I compile a simple hello world program in C and the results:
>
> hello_world.o -> 1.5 KB
> hello_world (linux executable) -> 8.5 KB
>
>
> Then I compile a simple hello world program in D (using DMD) 
> and the results:
>
> hello_world.o -> 9.3 KB
> hello_world (linux executable) -> 575.9 KB
>
>
> Then I compile a simple hello world program in D (using GDC) 
> and the results:
>
> hello_world.o -> 24.6 KB
> hello_world (linux executable) -> 13 MB !!!
>
> What's the reason for that? What makes D applications so much 
> bloated?
> Is this because whole GC implementation code is injected into 
> executable or maybe libphobos.a being statically linked or is 
> this because TypeInfo* ModuleInfo* stuff?

static linking is the really big thing here.


More information about the Digitalmars-d-learn mailing list