Thread overview
Output size
Mar 12, 2004
James Marjie
Mar 12, 2004
Andy Friesen
Mar 12, 2004
Ilya Minkov
Mar 12, 2004
James Marjie
March 12, 2004
I just downloaded and looked throught the samples. I built them and stood there flaber gasted at the exe file sizes. Is all that file size need to render hello world on the screen? It is probably just me as I come from assembly programming. I tryied using the -release option and got a 1k exe size reduction.

Any thoughts?


March 12, 2004
James Marjie wrote:
> I just downloaded and looked throught the samples. I built them and stood there
> flaber gasted at the exe file sizes. Is all that file size need to render hello
> world on the screen? It is probably just me as I come from assembly programming.
> I tryied using the -release option and got a 1k exe size reduction.
> 
> Any thoughts?

It's big for a simple program, but the overhead is constant.  As an application's complexity increases, that overhead becomes insignificant in the face of the amount of actual code.  (if you really, really need file size, there's probably a way to pull all the standard lib stuff out; you can with MSVC)

 -- andy
March 12, 2004
James Marjie wrote:

> I just downloaded and looked throught the samples. I built them and stood there
> flaber gasted at the exe file sizes. Is all that file size need to render hello
> world on the screen? It is probably just me as I come from assembly programming.
> I tryied using the -release option and got a 1k exe size reduction.
> 
> Any thoughts?

Try MinGW GCC with C++ (for a shock). Your Hello World is 200kb~ *after* stripping away everything you don't need :-o I agree though, the files are a little on the fat side. But I suppose it's the GC primarily that's to blame, and the GC can be rather useful as it is.

I recall from the Allegro (game programming library) documentation, for DOS you had to statically link and it used roughly 400kb or so:

If you think the ratio of library code to your code is too large, code some more! :-)

Cheers,
Sigbjørn Lund Olsen
March 12, 2004
You should have somewhat below 80 kilobytes. About 60 K goes to the standard C library (Walter doesn't like the M$ DLL version, but you can change it yourself by ripping off how MinGW does it). Then, about 15k or so are requiered for GC and groundwork of D features. I would bet that the ballast could be reduced to a few kilobytes, but at cost of either language compatibility and/or performance. I would also think that unused parts of C standard library don't get discarded too well.

Either way, i'm definately not trying to write a 4-kilobyte or 64-kilobyte intro in D. ;) Also be aware that classes carry a lot of information with them, which is usually unused, such as description of all feilds for serialisation, etc. And there are voices which call for even more static information. Through changed calling convention and reduced need for memory management in application, one would hope that application size need not be larger than with C++.

In principle, if someone gets to write a Sather-style agressive D compiler, one could get rid of the baggage. Not a proirity though, because what D should prove itself good at is writing large software, which should be not too much noticably less efficient than C++, or even more efficient at the points where it is important. However, these few kilobytes are not serious even for small utils, apart from esoteric uses sich as mini-intros. But hey, try to build a C++ Hello Worls with IOStreams, and enjoy something between 70 and 800 kilobytes, depending on the STL configuration. ;)

-eye

James Marjie schrieb:

> I just downloaded and looked throught the samples. I built them and stood there
> flaber gasted at the exe file sizes. Is all that file size need to render hello
> world on the screen? It is probably just me as I come from assembly programming.
> I tryied using the -release option and got a 1k exe size reduction.
> 
> Any thoughts?
March 12, 2004
In article <c2t5uk$268j$1@digitaldaemon.com>, Ilya Minkov says...

>In principle, if someone gets to write a Sather-style agressive D compiler, one could get rid of the baggage. Not a proirity though, because what D should prove itself good at is writing large software, which should be not too much noticably less efficient than C++, or even more efficient at the points where it is important. However, these few kilobytes are not serious even for small utils, apart from esoteric uses sich as mini-intros. But hey, try to build a C++ Hello Worls with IOStreams, and enjoy something between 70 and 800 kilobytes, depending on the STL configuration. ;)

Yeah, I don't use C++. I also read the release note from MinGW about the g++ thing. Due to licence issue they can't link to MS's version as they can for C. So they link in the all the C++ stuff.

Oh well, I was just messing around. I guess it's back to assembly. 8^)

Thanks for all the help. Will check back with D later.

James Marjie