Compiler: Size of generated executable file

retard re at tard.com.invalid
Sat Jan 9 17:06:03 PST 2010


Sat, 09 Jan 2010 23:51:51 +0000, div0 wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> retard wrote:
> <snip>
>> E.g. if I link against some GUI lib, the hello world window+label grows
>> to 2..5 MB. In Java the same app using Swing is still only a few
>> kilobytes (label + window + procedure to close the app is 1.2 kB to be
>> precise).
> 
> Yeah but that's because Swing (and everything else as well come to think
> of it) is in the class library which is stored in the java run time
> directory rather than it being linked into the app.

GTK+ is also a third party library. I can easily use it in any language 
and the resulting binary will be really small. In D a small hello world 
GTK+ GUI application was 2 MB, IIRC, when I used the bindings available 
somewhere.

> The java runtime is 70MB btw.

And D depends on some basic C libraries, I might guess. Agreed not 
everyone has Java installed, but when the end users have it, it's a large 
advantage to ship small binaries. If you host the binaries on the web, 
you can cut off 95% of the traffic expenses pretty easily by shrinking 
the distributables.

It's by all means ok to have few bloaty application on a system, but 
image if all programs started to consume 1000x as much space as now, 
software like Windows 7 would require 10 TB of disk space.

> 
> For some bizarre reason, I've got 600 Mb of different Java runtimes on
> my machine, even though I've only got one Java application installed
> that I use. God knows where the rest came from.

That's because you use windows.. it stores only one instance on *nixen - 
thanks to sane package managers.




More information about the Digitalmars-d mailing list