digitalmars.D - Executable Size
- Gambler (3/3) May 17 2006 I just compiled my firts D program. It is the word count program from so...
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (14/17) May 17 2006 Looks normal... Some reasons are:
- Unknown W. Brackets (7/12) May 17 2006 Because of the gc, std.file and such, you do get a penalty initially.
- Gambler (1/5) May 18 2006 Okay, that's a good thing to hear. Thanks for replies.
- Niko Korhonen (11/14) May 17 2006 Oh please. When I compile a C++ program with GCC the executable size is
I just compiled my firts D program. It is the word count program from some exapme on this website. Executable is 80kb. WC program in C is 20kb. My question is, is such situation common with D? Or is it just std.file library?
May 17 2006
Gambler wrote:I just compiled my firts D program. It is the word count program from some exapme on this website. Executable is 80kb. WC program in C is 20kb. My question is, is such situation common with D? Or is it just std.file library?Looks normal... Some reasons are: 1) the code for garbage collection 2) the static linking of Phobos lib C++ also tends to be a bit larger than C. (*especially* if you include the std lib) Is the code size for D really a problem ? --anders PS. For a sample I got: 12K hello_c 156K hello_d 368K hello_cpp With GDC on Mac OS X.
May 17 2006
Because of the gc, std.file and such, you do get a penalty initially. This has been discussed in the past and it's been shown that, generally, D scales better as you add more code - e.g. its fixed costs are higher but the variable costs are lower. Either way, for a non-trivial (or even semi-trivial) program, I doubt it'd be a major issue. -[Unknown]I just compiled my firts D program. It is the word count program from some exapme on this website. Executable is 80kb. WC program in C is 20kb. My question is, is such situation common with D? Or is it just std.file library?
May 17 2006
Because of the gc, std.file and such, you do get a penalty initially. This has been discussed in the past and it's been shown that, generally, D scales better as you add more code - e.g. its fixed costs are higher but the variable costs are lower.Okay, that's a good thing to hear. Thanks for replies.
May 18 2006
Gambler wrote:I just compiled my firts D program. It is the word count program from some exapme on this website. Executable is 80kb. WC program in C is 20kb. My question is, is such situation common with D? Or is it just std.file library?Oh please. When I compile a C++ program with GCC the executable size is at least several hundred kilobytes. When I compile a Haskell program, it's at least one megabyte and more if I use any external libraries. In a Scala program I need to distribute 1.5 MB runtime library along the runtime libraries and instruct the client to install those into their GAC. So I think D fares /very/ well in this regard. -- Niko Korhonen SW Developer
May 17 2006