Board index » cppbuilder » EXE size with components

EXE size with components


2003-11-25 03:08:09 AM
cppbuilder15
Hi, after making some tests putting components in a C++ Builder form here
are the results:
Executable with an empty form and a button is 454kb
Putting a TEdit goes to 460kb
Now, putting a TRzEdit (from Raize Components) goes to 1,28MB
because it adds
Putting a TsuiCheckBox (from SUI Pack) goes to 2,04MB
Putting a TTeButton (from KS Dev ThemeEngine) it goes to 2,76MB
Putting a TJvTimerList (from JCL Library) it goes to 3,23MB
Conclusion: I have a form with 5 components and a file with 3,32MB. Is this
valid?
Delphi just did a 580kb filename. What's wrong with C++Builder?
It seems that it puts ALL library, not only the selected component.
Is it a C++Builder limitation or my fault? The test has been made in two
computers,
the one with a clean installation of C++Builder + components with their
default
installation instructions.
Thanks!
 
 

Re:EXE size with components

Quote
Conclusion: I have a form with 5 components and a file with 3,32MB. Is this
valid?
Delphi just did a 580kb filename. What's wrong with C++Builder?
It seems that it puts ALL library, not only the selected component.
Is it a C++Builder limitation or my fault? The test has been made in two
computers,
link with a detailed map file and stare at it. it'll show you what
got pulled in from which object files, which might give you a clue.
or if you posted what you see, someone else might be able to provide
some help.
note that ilink is more likely to _not_ link something you need than
to link something you don't need, so odds are there's something about
the components that causes the linker to see the dependencies. and
that something is probably in the headers: if it was in the object
files i'd expect similar dependencies to be seen by delphi's linker.
but you never know.
you could also try a release build, and/or enable inlining. the headers
generated by dcc will often contain inlines that, if expanded, could trigger
other dependencies you wouldn't see in object pascal.
 

Re:EXE size with components

I tested with Release build, the same.
How can I enable inlining?
George
"Maurice Barnum" < XXXX@XXXXX.COM >wrote in message
Quote
>Conclusion: I have a form with 5 components and a file with 3,32MB. Is
this
>valid?
>Delphi just did a 580kb filename. What's wrong with C++Builder?
>It seems that it puts ALL library, not only the selected component.
>Is it a C++Builder limitation or my fault? The test has been made in two
>computers,

link with a detailed map file and stare at it. it'll show you what
got pulled in from which object files, which might give you a clue.
or if you posted what you see, someone else might be able to provide
some help.

note that ilink is more likely to _not_ link something you need than
to link something you don't need, so odds are there's something about
the components that causes the linker to see the dependencies. and
that something is probably in the headers: if it was in the object
files i'd expect similar dependencies to be seen by delphi's linker.
but you never know.

you could also try a release build, and/or enable inlining. the headers
generated by dcc will often contain inlines that, if expanded, could
trigger
other dependencies you wouldn't see in object pascal.

 

{smallsort}

Re:EXE size with components

Quote
I tested with Release build, the same.
How can I enable inlining?
add -vi or remove -v.. but the release config will take care of that
that enables inlining.
you'll need to look at the map file to get any further.
 

Re:EXE size with components

Quote
Executable with an empty form and a button is 454kb
Putting a TEdit goes to 460kb

Now, putting a TRzEdit (from Raize Components) goes to 1,28MB
because it adds
You are statically linking, right? No runtime packages? You may be
suffering from the dreaded unwanted package exports problems. Look at
the map file as Maurice suggest. Look for extra Raize components that
you aren't using. They will be source of your code bloat.
Also, run tdump on your exe:
tdump -ee foo.exe
Normally, EXE's don't export things, but BCB is a little weird. You
should see a debug hook routine, and probably an initialize and finalize
for every "unit" in your project (a unit being any cpp file that listed
#pragma package (smart_init)).
On top of that, you might see a bunch of raize component functions fly
by. If you only see TRzEdit, then fine. If you see a bunch of other
junk, then you are seeing a sign of the problem. I did this once for a
project using a single turbopower control, and got back about 20 pages
of exports from a variety of components I knew I wasn't using.
Unfortunately, there may not be a good solution. The way packages are
built in BCB is fundamentally flawed in ways that I wont go into here.
If your intereted, search for posts in this group by me (or Ed Diener
(sp?)) on google. keywords: unwanted package exports
h^2