| Thread overview | |||||
|---|---|---|---|---|---|
|
January 14, 2009 How to size optimize the executable? | ||||
|---|---|---|---|---|
| ||||
What bothers me about D is that the executables dmd generates are quite large. Some simple programs have almost 200 kb. I've tried packing them with kkrunchy, the result are still about 100 kb. By contrast, with Visual C++ such programs would be only a few kbytes (in release mode). Why is D generating such big executables? How is it possible to get them smaller? | ||||
January 14, 2009 Re: How to size optimize the executable? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Claus D. Volko | == Quote from Claus D. Volko (cdvolko@gmx.net)'s article
> What bothers me about D is that the executables dmd generates are quite large.
Some simple programs have almost 200 kb. I've tried packing them with kkrunchy, the result are still about 100 kb. By contrast, with Visual C++ such programs would be only a few kbytes (in release mode). Why is D generating such big executables? How is it possible to get them smaller?
Well, one reason is because D has a larger runtime that includes things like GC. Theoretically, this could be made into a shared lib, but I think there are higher priorities in the D community.
| |||
January 14, 2009 Re: How to size optimize the executable? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Claus D. Volko | Claus D. Volko wrote:
> What bothers me about D is that the executables dmd generates are quite large. Some simple programs have almost 200 kb. I've tried packing them with kkrunchy, the result are still about 100 kb. By contrast, with Visual C++ such programs would be only a few kbytes (in release mode). Why is D generating such big executables? How is it possible to get them smaller?
MS C++ generated executable use a shared runtime by default, try compiling with static libraries and see the difference. In D there's all sorts of typeinfo, the GC, the D and also the c runtime taking up space. The way to make significantly smaller executables is building a shared D runtime.
It's not too bad, a mingw compiled hello world is almost 500kb... (thanks to iostreams mostly).
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply