I have a program of about 20,000 lines of code and when compiled the .exe is about 1.3Mb.
I made a few minor changes and it jumped to 1.8Mb. The other thing strange is a 'build' shows something like 60,000 lines compiled.
I've changed something by accident that I didn't intend to but I don't know what it is....
Any ideas?
Thanks in advance
--
Geoff
"Geoff Elder" <ge...@myraceresults.com> wrote in message
news:3A578BBF...@myraceresults.com...
Hi Geoff,
Maybe you dropped a component on a form and then compiled or saved the
form before changing your mind. Compiling or saving will add the
appropriate unit to the form's uses clause. However, Delphi does not
automatically remove the unit if the component is removed. If the
component is part of a large package of interrelated units, this can add
a huge chunk of code to your app.
--
Carl
Thanks again,
On to the next problem.....
Geoff
Just taking on here -- a great way to reduce exe size for resources is
to use frames for the resource and refer to the frame on all your forms
instead of unique copies of the resource.
Talk about Stefan H.'s boasting about Delphi's smart linker. Bah! Delphi's
Linker is still dumb. Is smart with trivial things within a unit such as
ordinary functions and procedures, but for those units that contain a big
fat bloated OOP objects with initialization where it will add tremendous
EXE, Delphi's Smart Linker is the best OXYMORON there is!
So the linker should be smart enough to know when a programmer has included
a unit that they didnt want to?
--
Dave Nottage
Pure Software Technology
Isn't it really possible to automatically remove units where you did not
call anything from it, even initializations/finalizations that you do not
need in your code?
That would probably break a lot of exisiting code!
For example, I often include units in an application that register classes
with the delphi streaming mechanism. The units are not 'used' by any other
units in the application I also use the same technique to extend
applications, for example, registering forms with an application in the
initializaion section. I have a diagramming engine, in which I can add
object types to with one line of code to register them in the initialization
section. I could go on with dozens of examples of where your suggestion
would break exisiting code.
If the unit has an initialization section the linker has no choice but to
link in the unit, as initialization sections are meant be executed
automatically. It has no idea that you don;t really want it linked in! My
advice would be to clean up after yourself. By that I mean make sure you are
only including units that are needed. Simple but very effective.
HTH
Vincent Parrett
VSoft Technologies Pty Ltd
Email : vincent at vsoft-tech dot com dot au
Web : http://www.vsoft-tech.com.au
Perhaps, she came from VB and MS VC++ eh? Linking everything in is the norm, and
has heard of Delphi's smart linker to alleviate the process. Darn! Delphi
requires that a developer be smart as well <g>! No wonder not a lot of
MS-fanatics are flocking over... Oops my apologies in advance (only if you think
this is not a joke).
Barry...
There should be. Been a while since I looked at how the linker works,
but you should be able to determine what DCUs are in the binary, and how
large they are.
You can get the information from MAP file. In Project | Options -> Linker page
check MAP file - Detailed (although, Segments would be sufficient) and compile
your project.
--
Petr Vones (Team JEDI) - http://delphi-jedi.org