Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Optimizing code size

Status
Not open for further replies.

LemurX

Programmer
Joined
Jan 8, 2004
Messages
3
Location
MY
Is there anyway to reduce built code size in Delphi 7? I came a across a Delphi app about 222Kb in size, when I tried compiling the source myself, I got almost double that size.
Also unchecking all the Debug options and others in Project-> Options -> Compiler seem to have no effect on the final exe size? Any ideas? TQ
 
On project options, Linked tab, ensure that the following are not checked:
Include TD32 debug info
Include remote debug symbols
(These make a big difference to code size)

On project options, Compiler tab:
Uncheck all debugging options
Check Optizization
(These make a small difference to code size)

Under project menu Build (not compile) the project. With compile above changes are only implemented for units changed since last compile.

If you really need a small executable, you can build with packages, but you have to distribute the packages too and so total distribution size goes up. I don't recommend packages unless you have good reason.
 
With all the debugging info unchecked, the size of
a new VCL application (bare) is 368,128 bytes, is
this about right? TQ
 
lemurX,

this is correct, due to the VCL encapsulation of Windows controls + API you'll get this size. for more tips how to create a really small app look here thread102-747304.

greetings,

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top