Board index » delphi » Reducing the size of executables

Reducing the size of executables

Hi,

What is the best way to reduce the size of an executable file created
with Delphi 3?

TTFN
Arclight

 

Re:Reducing the size of executables


On Thu, 18 Nov 1999 01:45:17 GMT, daniel.dav...@cableinet.co.uk

Quote
(Arclight) wrote:
>What is the best way to reduce the size of an executable file created
>with Delphi 3?

One way is to compress it by one of PE-compressors (UPX, AsPack)
But this way reduce ONLY file size on disk (but not in memory).

Another is to visit my site and take ACL library. Application, created
with it takes about 40 - 70K (uncompressed). But application
development is is not visual.

Regards,
Alexander.

Alexander B. Bokovikov
E-mail: a...@adx.ru
WWW: http://a-press.parad.ru/pc/bokovikov/delphi

Re:Reducing the size of executables


In article <38335a07.9343...@news.cableinet.co.uk>,
  daniel.dav...@cableinet.co.uk (Arclight) wrote:
Quote
> Hi,

> What is the best way to reduce the size of an executable file created
> with Delphi 3?

> TTFN
> Arclight

I assume by "reduce the size of the executable file" you don't mean to
just compress the file with a zipper, as this just makes it smaller to
transport around to other computers and nothing more.  If you actually
mean "to extract extraneous information from the executable", then I
would like to know the answer also.  If you look at the exe in a binary
viewer you will see a lot of run time information which is only included
to assist in debugging eg text names of classes and events etc. which
the program does not actually need to know for its execution.  Even
turning off debugging information in the project settings does not
remove this information.  It could easily account for perhaps 20% of the
total exe size.  Unfortunately, most people just post answers to zip the
exe up rather than remove unnecessary sections of the file itself.

Trevor

Sent via Deja.com http://www.deja.com/
Before you buy.

Re:Reducing the size of executables


Quote
On Thu, 18 Nov 1999 21:59:57 GMT, th...@my-deja.com wrote:
>In article <38335a07.9343...@news.cableinet.co.uk>,
>  daniel.dav...@cableinet.co.uk (Arclight) wrote:
>> Hi,

>> What is the best way to reduce the size of an executable file created
>> with Delphi 3?

>> TTFN
>> Arclight

>I assume by "reduce the size of the executable file" you don't mean to
>just compress the file with a zipper, as this just makes it smaller to
>transport around to other computers and nothing more.  If you actually
>mean "to extract extraneous information from the executable", then I
>would like to know the answer also.  If you look at the exe in a binary
>viewer you will see a lot of run time information which is only included
>to assist in debugging eg text names of classes and events etc. which
>the program does not actually need to know for its execution.  Even
>turning off debugging information in the project settings does not
>remove this information.  It could easily account for perhaps 20% of the
>total exe size.  Unfortunately, most people just post answers to zip the
>exe up rather than remove unnecessary sections of the file itself.

It was the second one I was after, Because it seems daft releasing
some software which has all that extra data which does absolutley
nothing.

TTFN
Arclight

Re:Reducing the size of executables


Quote
Arclight wrote:
> [...]  If you look at the exe in a binary
> >viewer you will see a lot of run time information which is only included
> >to assist in debugging eg text names of classes and events etc. which
> >the program does not actually need to know for its execution.  Even
> >turning off debugging information in the project settings does not
> >remove this information.  It could easily account for perhaps 20% of the
> >total exe size.  Unfortunately, most people just post answers to zip the
> >exe up rather than remove unnecessary sections of the file itself.
> It was the second one I was after, Because it seems daft releasing
> some software which has all that extra data which does absolutley
> nothing.

I suspect that it's because "in these days of 600-megabyte CD-ROMs and
even-larger DVD's... it doesn't really matter."  When programmer time
costs $75 an hour and up (way up!!) and a CD costs a buck, diddling with
resources to squeeze out a few kilobytes just doesn't have a return on
investment.  Executable size simply does not matter as much as it used
to, but programmers have become more expensive than ever.

------------------------------------------------------------------------
Sundial Services :: Scottsdale, AZ (USA) :: (480) 946-8259
mailto:i...@sundialservices.com  (PGP public key available.)

Quote
> Got Paradox/Delphi database headaches?  ChimneySweep{tm} can help, FAST!
> http://www.sundialservices.com/cs3web.htm

Re:Reducing the size of executables


Quote
On Thu, 18 Nov 1999 21:59:57 GMT, th...@my-deja.com wrote:
>In article <38335a07.9343...@news.cableinet.co.uk>,
>  daniel.dav...@cableinet.co.uk (Arclight) wrote:
>mean "to extract extraneous information from the executable", then I
>would like to know the answer also.

I've given the proposed answer above. Remove VCL references and You'll
have native API without any extra information!
As an example visit my site and take ACL library - it is free with
source!

Quote
>If you look at the exe in a binary
>viewer you will see a lot of run time information which is only included
>to assist in debugging eg text names of classes and events etc. which
>the program does not actually need to know for its execution.  Even

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DON'N AGREE AT ALL!!! You must have in mind differences between simple
debug information, such as source line numbers, and RTTI, which is a
part of VCL and CAN NOT BE REMOVED if You use statements like:
if Sender is TPanel then ... or with Sender as TEdit do ... and You've
remember that even if You don't use them explicitly, they are alredy
used in such units as forms.pas - the main VCL unit.

Quote
>turning off debugging information in the project settings does not
>remove this information.  It could easily account for perhaps 20% of the
>total exe size.  Unfortunately, most people just post answers to zip the
>exe up rather than remove unnecessary sections of the file itself.

I assume that real code volume reducing can be made of 3 - 4 times of
that with VCL. For example simple window created with my ACL library
takes of about 35K. Why so much? This size can be reduced because in
this case the unit is linked similar to SysUtils.pas which (my module)
contains practicaly all system functions, file handling functions,
streams, version info and other. If You'll reduce this module then
you'll have exe size of about 20K.
By the way I've mentioned that if You'll include all units via {$I}
instead of use them as units then You'll have rather smaller EXE size.
But this way is unreachable in VCL too.

Onece more I've to repeat: THE ONLY REAL WAY TO REDUCE EXE SIZE IS TO
USE NATIVE API CALLS!

Regards,
Alexander.

Alexander B. Bokovikov
E-mail: a...@adx.ru
WWW: http://a-press.parad.ru/pc/bokovikov/delphi

Re:Reducing the size of executables


On Thu, 18 Nov 1999 19:28:18 -0700, Sundial Services

Quote
<i...@sundialservices.com> wrote:
>I suspect that it's because "in these days of 600-megabyte CD-ROMs and
>even-larger DVD's... it doesn't really matter."  When programmer time

What can I say? From one hand You are right, disk space costs less and
less... But don't remember about memory space! It costs less too (but
not so fast as we want unfortunately). So I see at least two areas
where small EXE are wellcomed. The first is some application are sent
via e-mail or www or ftp. Not all people have high speed satellite
channels yet. The second is to build some services for NT. I have some
experience and know that it is very hard to explane to network
administrator why my service takes so much of his high cost server
memory!

Regards,
Alexander

Alexander B. Bokovikov
E-mail: a...@adx.ru
WWW: http://a-press.parad.ru/pc/bokovikov/delphi

Re:Reducing the size of executables


On Thu, 18 Nov 1999 23:07:36 GMT, daniel.dav...@cableinet.co.uk

Quote
(Arclight) wrote:
>On Thu, 18 Nov 1999 21:59:57 GMT, th...@my-deja.com wrote:

>>In article <38335a07.9343...@news.cableinet.co.uk>,
>>  daniel.dav...@cableinet.co.uk (Arclight) wrote:
>>> Hi,

>>> What is the best way to reduce the size of an executable file created
>>> with Delphi 3?
[skip]

>TTFN
>Arclight

Vladimir Kladov asks:

XCL library (of main): http://xcl.cjb.net
ACL library of Alex Bokovikov:
http://a-press.parad.ru/pc/bokovikov/delphi/indexe.html

But these are non-vusual... sorry.
?? ???e ???a ?e????.

Re:Reducing the size of executables


On Fri, 26 Nov 1999 09:25:16 +0100, Richey / Delphi-Box <Support @

Quote
Inner-Smile.com> wrote:
>Hello,

>you can find a number of tips concerning this topic in my "Personal
>Delphi FAQ" in my "Richey's DELPHI-BOX".

>hope it helps!

Thanks, I'll have a look at that next time I get a chance.

TTFN
Arclight

Other Threads