Re: BDS2006 exe sizes
- From: "Maarten Wiltink" <maarten@xxxxxxxxxxxxxxxxxx>
- Date: Sat, 25 Feb 2006 11:03:50 +0100
"Ian" <ian610@xxxxxxxxxxxxxxxx> wrote in message
news:NyULf.2303$EA6.896@xxxxxxxxxxxxxxxxxxxxxxxx
[...]
I believe an efficient compiler would take even the smallest program
and optimize it and produce the smallest executable possible.
The arguments against that have been stated over and over. First of all,
the compiler _does_, and the actual code for "WriteLn('Hello world')"
already is quite small. It's the linker that then produces a Portable
Executable-formatted file that the OS can actually load and run, and
that other OSes cannot load and run, but in a controlled manner that
allows them to display "This program requires Microsoft Windows", for
example.
I'm not an expert on compilers, but
Hold that thought.
It might be a nice exercise to build a compiler yourself some time.
I did once, in university, and it was a great experience. There is an
immense sense of power and achievement in it. Even when you realise
that the compiler you're building it with is taking care of all the
gritty details like wrapping an actual program in code that makes it
callable from the OS and takes care of what actually happens with the
output. Roughly, providing the linker and (part of) the RTL. More than
you might think.
I just don't understand why 32-bit
Pascal/Delphi compilers produce such large exes for such simple
programs. Even without the SysUtils unit included, I feel the exe's
could still be more compact (maybe 5k?).
They might be, but it would probably require compaction/optimisation
techniques that apply only to very small, effectively uninteresting
programs. Would you thank Borland for spending their time on that?
Don't lose sight of the fact that "uses Forms, SysUtils" turns any
program into a nontrivial one instantly. SysUtils for instance loads
a slew of variables with your regional settings. That takes up space
both for the variables and for the code that initialises them. Forms
creates an Application variable which pulls in the entire TApplication
class. It derives from TComponent, that alone should tell you enough.
I think Forms also includes loads of initialisation code to couple
forms with IDE designers - or not, as the case may be, but again,
would you thank Borland for developing two different modules that are
both as small as physically possible, rather than one that _works_
in both cases? I know what I advocate at work. It keeps our software
reliable, which is a lot more important than "small".
Groetjes,
Maarten Wiltink
.
- References:
- BDS2006 exe sizes
- From: Ian
- Re: BDS2006 exe sizes
- From: Uffe Kousgaard
- Re: BDS2006 exe sizes
- From: Ian
- Re: BDS2006 exe sizes
- From: Uffe Kousgaard
- Re: BDS2006 exe sizes
- From: Ian
- Re: BDS2006 exe sizes
- From: Rob Kennedy
- Re: BDS2006 exe sizes
- From: Ian
- BDS2006 exe sizes
- Prev by Date: Re: BDS2006 exe sizes
- Next by Date: Re: MessageDlg function. Help
- Previous by thread: Re: BDS2006 exe sizes
- Next by thread: Re: BDS2006 exe sizes
- Index(es):
Relevant Pages
|