www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - a way to

reply eflick gmail.com writes:
Is there anyway to make the compiled exe's smaller in size? They're huge
compared to C++...

----------
Aug 04 2005
next sibling parent reply zwang <nehzgnaw gmail.com> writes:
eflick gmail.com wrote:
 Is there anyway to make the compiled exe's smaller in size? They're huge
 compared to C++...
 
 ----------
upx (with the --force option) may generally reduce the exe size by half.
Aug 04 2005
next sibling parent reply zwang <nehzgnaw gmail.com> writes:
zwang wrote:
 eflick gmail.com wrote:
 
 Is there anyway to make the compiled exe's smaller in size? They're huge
 compared to C++...

 ----------
upx (with the --force option) may generally reduce the exe size by half.
If you're more ambitious, say you want to write the first 64k demo in D, I guess the first step is to hack a minimal Phobos.
Aug 04 2005
parent Sean Kelly <sean f4.ca> writes:
In article <dctfcl$gh0$1 digitaldaemon.com>, zwang says...
If you're more ambitious, say you want to write the first 64k demo in D, I 
guess the first step is to hack a minimal Phobos.
At the moment, that would be Ares. Sean
Aug 04 2005
prev sibling parent SomeOne <SomeOne_member pathlink.com> writes:
In article <dctf42$ft7$2 digitaldaemon.com>, zwang says...

eflick gmail.com wrote:
 Is there anyway to make the compiled exe's smaller in size? They're huge
 compared to C++...
upx (with the --force option) may generally reduce the exe size by half.
I heard UPX has a nasty bug http://www.msoftware.co.nz/modules.php?op=modload&name=phpbb2&file=viewtopic.php&p=441&sid=4aaacc80660dcb0c0ef26caf19e2b2b5 Anyone knows if it has been fixed yet?
Aug 07 2005
prev sibling next sibling parent Tim Laurent <nanobyte gmx.com> writes:
eflick gmail.com wrote:
 Is there anyway to make the compiled exe's smaller in size? They're huge
 compared to C++...
I'd also like to know why there are that big ... According to http://www.catch22.net/tuts/minexe.asp, a C program that _includes_ the C runtime is around 20 - 30 KB. Is is neccessary to link a complete set of the D runtime into every executable, or can the linker only include the functions actually used? Not that I cannot live with a 100 KB compressed D executable, but I've really no clue what consumes the space ... -Tim
Aug 04 2005
prev sibling next sibling parent pragma <pragma_member pathlink.com> writes:
In article <dctbdp$cum$1 digitaldaemon.com>, eflick gmail.com says...
Is there anyway to make the compiled exe's smaller in size? They're huge
compared to C++...

----------
This has come up before. No matter what, you're in for some light hacking to circumvent this problem. Most of the bulk in the average D executable comes from the overall size of phobos.lib. Since the source for phobos is included with D, it's not too tough to build your own. Just pair down the set of included .d files to what you need and throw out the rest. Also, there is an alternative to phobos that is currently under development: Ares. Since its so new, it's far more lean than its cousin Phobos. http://www.dsource.org/projects/ares Now for the stuff that's hard to fix. I think DMD also pulls in some C runtime .libs (under the dmc tree) that are pretty much unavoidable. There may also be some linker options that will help reduce your program size as well. Both of these issues may be pretty well documented here on digitalmars.com, and on usenet. Also keep in mind that D *always* compiles in run-time type information; there's no way to turn it off as with most C++ compilers. - EricAnderton at yahoo
Aug 04 2005
prev sibling parent reply John Demme <me teqdruid.com> writes:
Under linux, running it through "strip" reduces the size from 139k to
96k.  Not a whole lot, but it's a start.

On Thu, 2005-08-04 at 15:15 +0000, eflick gmail.com wrote:
 Is there anyway to make the compiled exe's smaller in size? They're huge
 compared to C++...
 
 ----------
Aug 04 2005
parent Geert <gertje gertje.org> writes:
John Demme wrote:
 Under linux, running it through "strip" reduces the size from 139k to
 96k.  Not a whole lot, but it's a start.
 
 On Thu, 2005-08-04 at 15:15 +0000, eflick gmail.com wrote:
 
Is there anyway to make the compiled exe's smaller in size? They're huge
compared to C++...

----------
Hehe, well it's nearly 31 percent of it's original size smaller, that's a whole lot for me.. ;)
Aug 05 2005