Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 10-17-2010, 01:51 PM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 5,060
Default EXE file size Delphi7 vs Delphi XE

Greeting all,

I've downloaded Delphi XE (Delphi 2011) for evaluating purposes (one month trial). After compiling some old projects written using Delphi7 I notice that the exe file size generated by Delphi XE is more than twice the size of the one generated by Delphi7!!! Is this because of the Unicode feature? Or is it because of the new functions added to the most used units? Any idea why?
__________________
Regards,
Abdulaziz Jasser
Reply With Quote
  #2  
Old 10-17-2010, 09:34 PM
Glenn1234 Glenn1234 is offline
Senior Member
 
Join Date: Aug 2009
Posts: 131
Default

All I can say is this: The VCL is bloated, and it only gets more so the newer the revision of Delphi. The executable size doubled between D3 and TD2006, for example. I haven't studied TD2006 much (since it's so crippled), but for D3 I found this. To start with this program:

Code:
{$APPTYPE CONSOLE}
program test; uses empty_unit in 'empty_unit.pas';// uses Forms;
begin
  writeln('test');
  readln;
end.
It compiles to 15.5 KB (empty_unit is just a "new Unit" I created and then promptly saved so it would compile in the IDE). Now if I change "uses empty_unit" to "uses forms", the exe size grows to 171KB. This is due to all the resources attached to the VCL being put into the EXE. From the TD2006 executables, I can tell the problem has only grown worse, as it does with any aged software in repeated maintenance cycles.

More resources and more code equals bloat. But unfortunately that's a fact of life and it won't change, especially for Borland-whatever they call themselves now.

But to directly address your questions:
1) Delphi 3 supports the ability to use Unicode, so you can actually work with Unicode strings in the VCL controls by converting them. So this isn't much of an issue. If anything, my guess is the data requirements went up by converting the VCL to Unicode, but there is nothing new or different in supporting Unicode that hasn't already been in Delphi.
2) New functions always add more bloat to EXEs.

Truthfully, the answer is more in the inefficient use of resources than it is the addition of anything. I noticed this in trying to debug a problem in TBitmap - the VCL code is a rats nest! Unfortunately, addressing this requires scrapping the VCL and rewriting it, and I don't think that will happen.

Suggestion: Make sure you don't use units which have no corresponding resources used in your program. Remove the ones that don't and your EXE size will go down.

Edit: I repeated the test in TD2006. 18.5KB to 379KB upon adding "forms". It may be worth trying to load up one of these EXEs in Resource Hacker (or similar) and see what can be removed to lower the size.

Last edited by Glenn1234; 10-17-2010 at 10:41 PM.
Reply With Quote
  #3  
Old 10-18-2010, 12:13 PM
delphimpd delphimpd is offline
Senior Member
 
Join Date: Oct 2006
Posts: 701
Default

Jasser,

That is an issue that Embarcadero is looking at it closely. There are numerous of complaints reference to this and I am sure that they will address in near future updates.

Here is a temp Solution and I am sure you know about it and is calles UPX. It is free.

http://upx.org/

I had 38 MB compressed to 6 MB. It is supper fast, you wont notice the difference.

Just drag and drop your .Exe onto UPX and Done.

Regards
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 01:37 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.