views:

265

answers:

6

already delphi win32 exe size is ~850 kb , do they have any roadmap of making exe size bit smaller,(i know that the size is because of vcl unicode RTTI and many more ),delphi compiles the whole unit even only a small function in the unit is needed. so is there any facilities to do so,or third party products are there , (i know kol and mck do the same)

+9  A: 

I doubt that exe size is much of a concern for the Delphi team, or even for most of the users as well. As you noticed, unicode and new RTTI increase the size, and while you can turn of new RTTI there really is not much else you can do about it.

In general each new Delphi version produced larger exes, I don't see this trend changing.

As for compiling whole units that isn't correct, unless you compile packages the compiler will not include non used methods and declarations.

If exe size is important you don't have much choice. If you don't need unicode and other new features then using D2007 or D7 or even D2 is an option.

You can use exe packers such as UPX.

If you build a set of applications you can reduce total size by using shared packages.

Also check out these:

Daniel Maurić
A: 

You certainly shouldn't expect exe size for future 64-bit Delphi versions to be smaller than current 32-bit Delphi exe files.

On the contrary: pointers and pointer-sized types will double in size and other data structures may grow in size due to padding (to meet alignment requirements). All of this gets compiled into the executable, the size of which will therefore grow.

PhiS
A: 

The path looks to be exes will become larger, in the future. Application size became far less important since disk sizes, bandwith and memory footprint rarely are a problem in the Windows world. There's always been a tradeoff between exe size and exe optimization (some optimization techniques can make an exe larger), and a 64 bit executable will probably be somewhat larger. Also improvements to the language may require more data to be stored about the code itself (i.e. RTTI informations). There are techniques to keep an exe size small, but they usually require to bypass most of the Delphi OOP and RAD features and libraries. Unless you have very special needs, rarely the exe size is an issue (although I understand that is some parts of the world bandwidth still matters, and maybe disk space too).

Anyway AFAIK it is not true Delphi linker will import a whole unit. Unused calls will be removed, although not everything you would like to be. The dcu will be compiled as a whole, but only needed code will be moved to the compiled executable. Something may depend on your compilation options. Did you activate the optimization option?

ldsandon
A: 

I guess the Free Pascal faq on this goes for Delphi too:

http://wiki.freepascal.org/Size_Matters

Marco van de Voort
+2  A: 

I'm not sure what kol and mck have to do with your question about .EXE size.

The presumption in your question that a unit is always completely included in your .EXE, even if only a small portion of the unit is actually used, is plain wrong.
Delphi has both a code optimizer and a linker optimizer.
The latter will not include code from a unit in your .EXE if that code is not actually somehow used.

Your more general question 'do they have any roadmap of making exe size bit smaller' can be answered by a simple 'No'.
The current roadmap does not include that.

--jeroen

Jeroen Pluimers