Re: BDS2006 exe sizes



On Sat, 25 Feb 2006 07:52:33 GMT, Rob Kennedy wrote:

You need to agree on exactly what code you're using. The code
Dodgy showed (duplicated below) is Delphi's default console-mode
program. Note that it includes the SysUtils unit, which drags in a
lot of exception-related code. Ian, the size you just cited
suggests you didn't include SysUtils in your code. That would
account for the great difference in size.

Ahh, I see. I wasn't including any units with my test. A test with
the SysUtils unit in D7 produces an exe of 41,984 bytes. The same test
(with SysUtils included) using D4 produced an exe of 40,448 bytes. Not
much difference.

In Delphi 2005, a console-mode program with SysUtils is about 40
KB. Without SysUtils, it's about 13.5 KB.

Really? If that's true, then that's excellent! That would beat D4 and
D7 hands down. I almost find it hard to believe.

I wonder how you see this program as a test of a compiler's
efficiency. The compiler only processes one line of code. (And I
suspect the code generated by the compiler for that line hasn't
changed by more than a few bytes over the past decade.)

I believe an efficient compiler would take even the smallest program
and optimize it and produce the smallest executable possible. I'm not
an expert on compilers, but 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?).


.



Relevant Pages

  • Re: FindClose
    ... Either swap the order of these two units or use the ... To tell the compiler to use the FindClose in the SysUtils unit. ...
    (borland.public.delphi.language.objectpascal)
  • Re: FindClose
    ... > It means that you have got SysUtils and Windows in your Uses list and the ... > To tell the compiler to use the FindClose in the SysUtils unit. ...
    (borland.public.delphi.language.objectpascal)
  • Re: Exception Handling...
    ... >I've been going through parts of the Delphi 7 RTL fixing a couple of minor ... >interface of the SysUtils unit have come in handy as I can turn exception ... >The exception handling code, scattered between the System and SysUtils units ... >Produces an exe of about 33k. ...
    (comp.lang.pascal.delphi.misc)