Filesize of D binaries?

Mike Simons ixulai at gmail.com
Sat Jan 6 08:06:33 PST 2007


Frits Van Bommel wrote:
"""writef an friends call a function to handle the formatting. Since
they're variadic functions, that function needs to be able to handle any
type. So it contains code for every primitive type, structs, classes,
etc. The compiler can't (currently) determine which of those are unused
so it includes all of that code, plus any code they in turn need, and so on. """

Ah; that would explain it. My main concern was that as you started getting larger
programs the size would be proportional, but given what you've said it shouldn't
be. Infact, beyond a certain amount of imports the size should stop rising
drastically as more and more dependencies are met with the code that is already
linked?

Anders F Björklund wrote:
"""250K sounds a bit much, like if debugging symbols wasn't stripped ? """

The exact command I used was "gcd hello.d -o hello". I tried various other flags
like O3 and frelease and neither made any difference whatsoever.
However, when I compiled the exact same code using gdc on win32 (under mingw) it
was only ~100k.

I guess this is due to size differences between the static libs on each platform .



More information about the Digitalmars-d mailing list