Thread overview | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
December 10, 2011 What can be done to reduce executable size? | ||||
---|---|---|---|---|
| ||||
Short term and long term suggestions ? Anything we can do ? I heard it is some problem with linking dead code? import std.stdio; int main(){ writefln("Hello Bloat!"); return 0; } dmd -release -O hello.d On Windows: v1.071 = 339 Kb v2.056 = 1017 Kb It looks very ugly and might distract some people. |
December 10, 2011 Re: What can be done to reduce executable size? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bane | > On Windows:
> v1.071 = 339 Kb
> v2.056 = 1017 Kb
v2.057b= 840 kb (upx --best = 151 kb)
|
December 10, 2011 Re: What can be done to reduce executable size? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mirko Pilger | Mirko Pilger Wrote:
> > On Windows:
> > v1.071 = 339 Kb
> > v2.056 = 1017 Kb
>
> v2.057b= 840 kb (upx --best = 151 kb)
>
That is improvement. 2.07 is not released yet ?
And I don't think UPX is solution. It makes things look even worse, like too much makeup on ugly chick.
|
December 10, 2011 Re: What can be done to reduce executable size? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bane | On 12/10/11 4:55 PM, Bane wrote:
> That is improvement. 2.07 is not released yet ?
Yeah, 2.057 is still in beta (expect a release during the next few days, though). It has some Phobos/druntime changes geared specifically towards reducing executable size.
David
|
December 10, 2011 Re: What can be done to reduce executable size? | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Nadlinger | Is it possible to move phobos or runtime to shared lib ? It would reduces code significantly. |
December 10, 2011 Re: What can be done to reduce executable size? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bane | I am dealing with scenario of large numbers of programs written in D placed on same host/1 installer, when it all sums up size does matters.
> Is it possible to move phobos or runtime to shared lib ? It would reduces code significantly.
|
December 10, 2011 Re: What can be done to reduce executable size? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bane | Try using the unilink linker: ftp://ftp.styx.cabel.net/pub/UniLink/ Get ulnb0329.zip You have to configure ulink.cfg to this: -zsnn.lib -LC:\dmd\windows\lib -LC:\dm\lib -Go -zkernel32;advapi32;user32;wsock32;shell32;snn.lib -LC:\dmd2\windows\lib -Go Then linking is just: ulink <file1>.obj <file2>.obj <lib>.obj etc.. |
December 10, 2011 Re: What can be done to reduce executable size? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bane | Am 10.12.2011, 17:17 Uhr, schrieb Bane <branimir.milosavljevic@gmail.com>: > Is it possible to move phobos or runtime to shared lib ? It would reduces code significantly. Theoretically but there are some hurdles (esp. regarding the runtime/gc). Some people have already tried this (on Linux of course), I'm not sure what the current status is. |
December 10, 2011 Re: What can be done to reduce executable size? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bane | > Short term and long term suggestions ? Anything we can do ? I heard it is some problem with linking dead code? Well most space is covered by the runtime, TypeInfo and stuff like struct .init data. Use http://thecybershadow.net/d/mapview to get a graphical view of your app. E.g. on Linux it sometimes shows Afterpadding way too large. |
December 10, 2011 Re: What can be done to reduce executable size? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Trass3r | Trass3r Wrote:
> > Short term and long term suggestions ? Anything we can do ? I heard it is some problem with linking dead code?
>
> Well most space is covered by the runtime, TypeInfo and stuff like struct .init data.
>
> Use http://thecybershadow.net/d/mapview to get a graphical view of your
> app.
> E.g. on Linux it sometimes shows Afterpadding way too large.
Yes, I use it, great piece of work.
|
Copyright © 1999-2021 by the D Language Foundation