.EXE is almost twice a big in Delphi 2010 compared to Delphi 7?

While migrating from Delphi 7, I have a program whose .exe is about 18 megs 
in Delphi 7, but in Delphi 2010, it's about 35 megs.

Is this in line with what others have seen, or am I missing some switch?

I'm configuring the "Release" Build Configuration.  And I'm right-clicking 
on "Release" in the Project Manager and selecting Build.

I haven't been able to find any addition project options to bring this 
number down:

Current Configuration:

Emit RTTI: False
Debug info: False
Map file: Off
Include Remote debug symbols:
{$WEAKLINKRTTI ON} in all my units. (But did not recompile system units...)
{$RTTI EXPLICIT METHODS([]) PROPERTIES([]) FIELDS([])} at the top of .dpr

Are there any other suggestions other than UPX?

Is rebuilding the VCL/RTL with RTTI worth looking into?

Links on this topic:

https://forums.embarcadero.com/thread.jspa?threadID=24416
http://blogs.embarcadero.com/michaelrozlog/2009/08/31/36979#comment-1400
http://docwiki.embarcadero.com/RADStudio/en/WEAKLINKRTTI_directive_%28Delphi%29
http://www.nexusdb.com/forums/showthread.php?t=15516
http://www.zipplet.co.uk/index.php/content/articles_programming_delphi2010rtti - 
rebuilding VCL/RTL
http://stackoverflow.com/questions/2150025/how-to-achieve-smaller-size-of-the-executable
0
Tom
6/18/2010 2:08:03 AM
embarcadero.delphi.win32 2183 articles. 0 followers. Follow

14 Replies
1439 Views

Similar Articles

[PageSpeed] 36
Get it on Google Play
Get it on Apple App Store

Tom Field wrote:

> While migrating from Delphi 7, I have a program whose .exe is about
> 18 megs in Delphi 7, but in Delphi 2010, it's about 35 megs.
> 
> Is this in line with what others have seen, or am I missing some
> switch?

No. The RTL and VCL has added quite a bit of stuff since D7, the fact
that all strings are Unicode also adds a bit (all string literals
stored are now twice the size), the new extended RTTI also adds quite a
bit (which you cannot all remove).

> Is rebuilding the VCL/RTL with RTTI worth looking into?

You cannot do that anyway.



-- 
Peter Below (TeamB)  
Don't be a vampire (http://slash7.com/pages/vampires), 
use the newsgroup archives :
http://codenewsfast.com
http://groups.google.com
0
Peter
6/18/2010 6:06:57 PM
> {quote:title=Peter Below wrote:}{quote}
> Tom Field wrote:
> 
> > While migrating from Delphi 7, I have a program whose .exe is about
> > 18 megs in Delphi 7, but in Delphi 2010, it's about 35 megs.
> > 
> > Is this in line with what others have seen, or am I missing some
> > switch?
> 
> No. The RTL and VCL has added quite a bit of stuff since D7, the fact
> that all strings are Unicode also adds a bit (all string literals
> stored are now twice the size), the new extended RTTI also adds quite a
> bit (which you cannot all remove).
> 
> > Is rebuilding the VCL/RTL with RTTI worth looking into?

> You cannot do that anyway.
> 
> 

Thanks, Peter.  Growing a bit from 18 megs I'd understand, but to 35 was really surprising. It's hard to image that changes to the code generation or to Unicode strings could account for that much growth!

As for rebuilding the VCL/RTL, this guy >  [link|http://www.zipplet.co.uk/index.php/content/articles_programming_delphi2010rtti]  seemed to think it could be done. I was hesitant to touch the core library and figured it wouldn't have helped much anyway...

Thanks again (for this answer and for all the contributions you've given to the Delphi community!)

Edited by: Tom Field on Jun 18, 2010 11:11 AM
0
Tom
6/18/2010 6:13:02 PM
Hello,

Tom Field wrote:

> Is rebuilding the VCL/RTL with RTTI worth looking into?

it depends. Personally, about every single other task I have is more
important than to reduce the executable size of my applications.

-- 
Moritz

"Hey, it compiles! Ship it!"
0
Moritz
6/18/2010 6:21:51 PM
Tom Field wrote:

> While migrating from Delphi 7, I have a program whose .exe is about
> 18 megs in Delphi 7, but in Delphi 2010, it's about 35 megs.

Just wondering: 

1) how many source lines are reported after doing a build (see Project
-> Information for <appname>)?

2) how many dfm-files do you have in this project and what is the total
size of these dfm-files.

-- 
Pieter

"It was God who made me so beautiful. If I weren't, then I'd be
 a teacher." -- Linda Evangelista.
0
Pieter
6/19/2010 1:44:17 AM
"Tom Field" wrote
> While migrating from Delphi 7, I have a program whose .exe is
> about 18 megs in Delphi 7, but in Delphi 2010, it's about 35 megs.

What is the smallest Delphi 2010 "Hello World" program?

procedure TForm1.Button1Click(Sender: TObject);
begin
  Edit1.Text := 'Hello World from D5';
end;

With debug checking turned on 
In D5 it is 297K bytes and
in D7 it is 373K bytes.

--JohnH
0
John
6/19/2010 3:12:56 AM
Am 19.06.2010 05:12, schrieb John Herbster:
> "Tom Field" wrote
>> While migrating from Delphi 7, I have a program whose .exe is
>> about 18 megs in Delphi 7, but in Delphi 2010, it's about 35 megs.
>
> What is the smallest Delphi 2010 "Hello World" program?
>
> procedure TForm1.Button1Click(Sender: TObject);
> begin
>    Edit1.Text := 'Hello World from D5';
> end;
>
> With debug checking turned on
> In D5 it is 297K bytes and
> in D7 it is 373K bytes.
>
> --JohnH

825k as GUI application
  23k as console application

But honestly, does size really matter?

Uwe Raabe
0
Uwe
6/19/2010 7:09:51 AM
196 Kb - 201.216 Bytes on Delphi 1 (Compiled inside DosBox emulating Windows 
3.11)

I'm a bit impressed about the size of my applications on Delphi 2010, but, 
doesn't matter at all... I'm using the new RTTI and loving it... I'm using 
the new things on VCL and loving it MORE...
My auto-update system works with .zip files anyway, I get a really nice 
compression rate (44% of original size)...
0
Sergio
6/19/2010 8:48:27 AM
Uwe


>But honestly, does size really matter?

Depends on wether the extra bytes are doing something useful or wether it just more bloat.

Roy Lambert
0
Roy
6/19/2010 12:36:27 PM
Am 19.06.2010 14:36, schrieb Roy Lambert:
>> But honestly, does size really matter?
>
> Depends on wether the extra bytes are doing something useful or wether it just more bloat.

So that strongly depends on your personal situation: When you use 
Unicode then the extra bytes for the strings are useful, otherwise it is 
bloat. The same is true for RTTI, either you use it or you don't. Let 
alone the many enhancements in the RTL and VCL. I personally won't go 
without them. If exe size is the only drawback, so be it.

Uwe Raabe
0
Uwe
6/19/2010 1:58:56 PM
Uwe

>So that strongly depends on your personal situation: When you use
>Unicode then the extra bytes for the strings are useful, otherwise it is
>bloat. The same is true for RTTI, either you use it or you don't. Let
>alone the many enhancements in the RTL and VCL. I personally won't go
>without them. If exe size is the only drawback, so be it.

As with Tom I find the extent of the growth hard to comprehend. 18Mb to 35Mb is a LOT of strings and I doubt that the RTL & VCL has had that level of enhancements.

Roy Lambert
0
Roy
6/19/2010 5:20:37 PM
> it depends. Personally, about every single other task I have is more
> important than to reduce the executable size of my applications.

IMO it very much depends on the type of application. It can be an issue if a lot 
of people are downloading your software. If you can save 10 MB per download, you 
save 1000 GB for 100,000 downloads.


-- 
Jens Gruschel
http://www.pegtop.net
0
Jens
6/19/2010 8:58:58 PM
Hello,

Jens Gruschel wrote:

> IMO it very much depends on the type of application.

sure.

-- 
Moritz

"Hey, it compiles! Ship it!"
0
Moritz
6/19/2010 9:40:59 PM
> Uwe says:
>>But honestly, does size really matter?


"Roy Lambert" wrote
> Depends on whether the extra bytes are doing something useful or whether it 
> just more bloat.

When programs are filled with bloat, it slows them down by reducing the locality 
of reference and thus the (effectiveness of the cache) ; it increases the time 
required to download and install; it increases the time required for auditing 
for malware, and thus the likelihood of a program containing malware; it 
increases the time required to research for ways to improve the code; and 
re.   --JohnH
0
John
6/20/2010 3:37:34 AM
> {quote:title=Pieter Zijlstra wrote:}{quote}
> 
> Just wondering: 
> 
> 1) how many source lines are reported after doing a build (see Project
> -> Information for <appname>)?
> 
> 2) how many dfm-files do you have in this project and what is the total
> size of these dfm-files.
> 
> -- 
> Pieter
> 
Good questions, Peter!  I enjoyed writing a small utility to determine the dfm info below:

900k lines of code is compiled during a build.  There are 400 dfm files that get compiled. The dcu's that are created (+from the dfms only+) are 7 megs in size. 

7,000,000/400 = 17 k/dfm average dfm filesize

Ignoring the 10 largest dfms:  10 k/dfm average size

Ignoring the 100 larges dfms: 4 k/dfm average size

The good news: as a result of mining the above data, I found several dfm's that were 1+ meg in size due to some large icons and images that weren't needed.  After eliminating those,  my final .exe size dropped several megabytes to about 30 megs. Nice improvement, but still more than twice the size of the Delphi 7 exe..

The dfm's don't have a lot of large images that we might move out into a resource file we load at run-time. (And that wouldn't solve the overall size problem anyway: I think this is a code generation issue, not Unicode strings or dfm size.

I keep thinking there must be some compiler or linker switch I've missed -- but haven't been able to find any.  

To those who wonder why I care about file size when there are so many other "more important" things to work on:    I agree: in this day and age, file size matters less -- and in many situations, probably not at all. However our product contains quite a few .EXEs that can't be split into sharable libraries and .exes. We supply our product on CD (not DVD).  If the deliverable EXEs grow by two-fold, we wont' be able to fit them onto a single CD and will need to manufacture and ship a second CD.  That's not a
 path we want to go down...

Thanks to all who have posted to this thread.

Edited by: Tom Field on Jun 21, 2010 9:33 AM
0
Tom
6/21/2010 4:34:48 PM
Reply:

Similar Artilces:

Migrating From Delphi 7 to Delphi 2010
We did not know which forum was the best for this question. We have been wanting to migrate from Delphi 7 to a later version for years but it appears to be a daunting task. We first looked at D2006 and that was a radical new world. We bought D2010 a couple of years ago and not done much with it because there are so many parts to our applications. We have done a few new applications in D2010 and they seem to work okay. D2010 has not been impressive, perhaps because of the strangeness compared to D7. Is is possible for us to do a phased sort of migration where we do a form at a time? ...

Using Delphi 7 and Delphi 2010
I had a project in Delphi 7. I worked on it in Delphi 2010. When I try to open the .dpr again in Delphi 7, the IDE toolbar widens across both monitors, and Delphi 7 locks up. It appears that Delphi 2010 modifies the .dpr in a way that makes Delphi 7 unable to open it again. All my forms & units appear to open fine in D7 after D2010, except for the warnings on the ExplicitHeight and ExplicitWidth properties being missing... I can easily recreate the .dpr, but is this expected behavior? Thanks. Tom Field wrote: > I had a project in Delphi 7. > > I worked o...

Pchar for PansiChar
hello, I use a DLL developed in D7 and not have the same sources. I will use Delphi 2010 and the functions do not work function TkmInitialize(LOGXMLDIR: PChar; TkmByExt: dWord): dWord; stdcall; external 'trackbuffer.dll'; function TkmCreateStream(FileName: PChar; Var Stream: dWord; Var Error: dWord): PChar; stdcall; external 'trackbuffer.dll'; function TkmLogEnd(Stream: dWord; MediaDuration, MediaPosition, MediaType: dWord; MediaName: PChar): dWord; stdcall; external 'trackbuffer.dll'; function TkmIsTkm(FileName: PChar): Bool; stdcall; external 'trackbuffer.dl...

Delphi 7 to Delphi 2010
We have decided to move up some applications running under Delphi 7 to Delphi 2010. However, I was surprise to see that simply recompiling the application causes the application to be much slower than version 7. We have a lot of string transformation routines, some mathematical transformations, etc. When I mean slower, I mean up to two times slower than with Delphi 7, so it not a minor difference. (The EXE is also a lot bigger but I don't worry too much about that). Is there something I can do to obtain the same kind of speed I had in Delphi 7 but with Delphi 2010? ...

Win32 program: Delphi 7 vs Delphi XE5
How is a D7 Win32 program compared to a Delphi XE5 one in terms of stability and performance? Is Delphi XE5 good enough for a big ERP project with several DLL's and hundreds of units and forms? Thanks in advance Am 26.12.2013 15:02, schrieb lior ilan: > How is a D7 Win32 program compared to a Delphi XE5 one in terms of stability > and performance? > Is Delphi XE5 good enough for a big ERP project with several DLL's and > hundreds of units and forms? > Thanks in advance > Hello, XE5 has increased functionality. Stability seems to be ok for most ...

Code works in Delphi 7 but not in Delphi 2010 [Edit]
hello, i have a procedure that open's a file by passing the file name as the parameter to the executable. something like this {code} C : \ P r o g r a m F i l e s \ Da c k e r \ D r a c k e r . e x e " G : \ D E l p h i 7 \ D e l p h i 7 A p p _ l o g . t " {code} The source code is {code} procedure OpenFileWithExe var hReg: HKEY; Ret: Longint; RegDataType, RegDataSize: DWORD; CmdLine: array [0..560] of Char; Len: Integer; SInfo: TStartupInfo; PInfo: TProcessInformation; begin Ret := windows.RegOpenKeyEx(HKEY_CURRENT_USER, ...

Delphi 7 to Delphi XE
Have been using Delphi 7 for many moons ( have got later versions but never upgraded to ) My first problem is: Component Palette. in XE it is a small toolbar docked in top right in Delphi 7 it gives a large view of all the components. I am struggling to be able to cope/access my components.in Delphi XE. Can I make the component pallette tool bar the same size as Delphi 7, or is there a fast way to view/choose all available components in XE, that I have not spotted yet? Kind Regards, Robert. Hi, What I know is that in Delphi 2010 and XE you can choose between t...

from delphi 6 to delphi 2010
Hi. It is possible, with component RX, dxforumlibrary, InfoPower3000Pro, StringAlignGrid. Accepts communication BDE. Thank by comments. excequiel arostica wrote: >Hi. > It is possible, with component RX, dxforumlibrary, >InfoPower3000Pro, StringAlignGrid. Accepts communication BDE. > >Thank by comments. Rx is dead and sources are taken over by jcl/jvcl. I dont know about the rest of the components and i have no experiences with bde over the last 9 years. excequiel arostica wrote: > Hi. > It is possible, with component RX, dxforumlibrary,...

Delphi 7 to Delphi XE2
Hi, Still using that old workhorse, Delphi7, but am going to the conference in London hosted by Embarcadero on Delphi XE2. Although I would like to "move with the times" and am keen to get the UNICODE and 64-bit support offered by the latest IDEs, I confess to being more than a little scared about all the UNICODE/String/AnsiString and 32/64 bit issues I'm probably going to fall over. Anyone recently upgraded from Delphi7 to one of the latest Delphi IDEs? Thanks, Alain On 03/02/2012 08:55, Alain Dekker wrote: > Still using that old workhorse, Delphi7, but...

Delphi 2007 to Delphi 7
I've written a class in Delphi 2007 that is not supported in Delphi 7. What would be the best way to achive what I've done in Delphi 2007 in Delphi 7? Thanks, Tom type BondConstants = class { Bond Types } type BondType = record const TREASURY = 3; AGENCY = 0; CORP = 1; MUNI = 2; SBA = 5; MBS = 4; CMO = 6; end; { Day Count Methods } type DayCount = record const ACTUAL_360 = 2; ACTUAL_365 = 1; ACTUAL_ACTUAL = 1; d30_360 = 0; ...

Delphi XE / Delphi 2010
Hello! I noticed that Embarcadero® Delphi® 2010 Version is not on the list of products on Embarcadero page. Or is it still possible to buy it? Will RAD Studio XE compile programs written in Delphi 2010 without problems.? Thanks. Am 13.09.2010 09:04, schrieb Petra Nemec: > Will RAD Studio XE compile programs written in Delphi 2010 without problems.? As always you will probably have to recreate the projects as the import is still a bit -- special. Christian Hello! Does anybody know if it is still possible to get a Delphi2010 trial version (if yes where)? ...

Win32 Delphi language features introduced since Delphi 7
Hi, Am I right in thinking that the language features introduced since Delphi 7 fall into the categories: a) language features dictated by .Net compatibility. e.g. Namespaces, Inlining, records with methods, operator overloading, pure interfaces, generics, extended RTTI and reflection; b) Unicode strings and supporting procedures? c) 64-bit support What other language features, if any, have been introduced since D7? Had most of the post-D7 languages features, except for generics, Unicode strings, and 64-bit support, been introduced in or before Delphi 2005? How bug-free were ...

dynamical DLL loading in delphi 7 & delphi 2010
Hello, i am loading a DLL dynamical in Delphi 7 and Delphi 2010: [delphi] var hDLL: THandle; pCode: Pointer; type TProcMainEntry = function: TForm; begin hDll := 0; if FileExists(Pfad + vpeDllName) then hDLL := LoadLibrary(PChar(Pfad + vpeDllName)) else SetLastError(2); if hDLL = 0 then RaiseLastOSError; pCode := GetProcAddress(hDLL, PChar(vpeFunction)); if pCode = nil then RaiseLastOSError; Result := TProcMainEntry(pcode)(); [/delphi] in delphi 7 there's a variable filled with data of the main application which used in the...

Delphi XE2 Translation Manager is crippled compared to Delphi 7
Delphi XE2 Translation Manager enables editing only of the properties that were previously saved to the DFM file. That means only properties that were changed from their default values in the original source language form. So if a TLabel Alignment is taLeftJustify I can't edit or even see its value in the translated form grid editor. Delphi 7 Translation Manager enabled editing and viewing of all the properties of a component included in the form. It also enabled editing properties using the Object inspector. Am I missing some definition in Delphi XE2 to enable all properties ...

Web resources about - .EXE is almost twice a big in Delphi 2010 compared to Delphi 7? - embarcadero.delphi.win32

Compared To Yahoo And Formspring, Is Facebook A Secure Network?
Facebook may play fast and loose with most of your personal information , but at least it has never had a major password breach — like Yahoo ...

Boston Globe sells for $70 million. Not much compared to...
The NYT sold the Boston Globe to the owner of the Boston Red Sox for $70 million . HootSuite, a Twitter and Facebook utility, raised $165 million ...

Why do so many MIT grads wear their class ring, compared to other colleges?
Answer (1 of 4): I've asked fellow graduates why they wear their ring, and their answers can be fit into a few buckets: pride, conversation piece, ...

iPhone 4 Rotated + Compared with iPhone + iPhone 3GS - YouTube
New! Hands-on video of Apple's iPhone 4, rotated on all angles and compared with the first iPhone and iPhone 3GS, side-by-side. From leading ...

Medium SUVs compared
We pit nine of the best-selling SUVs against each other.

7-seaters compared: Kia v Honda v Peugeot v Fiat v Subaru (06:38)
We test the latest sub-$40,000 seven-seat people movers to see which one is best in class.

WA on its own compared to other states
WA on its own compared to other states

Australian minister Barnaby Joyce dismisses red meat-cancer link, says processed meat shouldn't be compared ...
Australia's Agricultural Minister believes that the World Health Organisation's claim that processed meat can cause cancer is a “farce.”

Planhacker: iPhone 4S Australian Launch Pricing Compared
Optus, Telstra, Vodafone and Virgin Mobile have all announced their contract launch pricing for the iPhone 4S, which goes on sale this Friday ...

George St Sydney bus closure compared to Melbourne Swanston St closure
THE journey to work for hundreds of thousands of commuters in Sydney will never be the same again. Next week, the city centre’s main artery starts ...

Resources last updated: 1/22/2016 4:12:20 PM