[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Is D6 linker unsmart, or is there another explanation

Posted on 2004-11-17
9
Medium Priority
?
324 Views
Last Modified: 2010-04-05
points to anyone who can a) confirm b) explain c) tell me how I can fix it .. ie make D6 produce exes and dlls the same size as D5


Is the smart linker in D6 broken?

For a do nothing app and dll (source and compiler switches below),
I get the following compiled sizes.
     exe   dll
D5  288kb  59kb
D6  386kb  147kb

This is with D5 Pro and D6 Pro.

can someone who has a comparable version of D6 please confirm.



{$A+,B-,C-,D-,E-,F-,G+,H+,I-,J+,K-,L-,M-,N+,O+,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y-,Z1}
{$MINSTACKSIZE $00004000}
{$MAXSTACKSIZE $00100000}
{$IMAGEBASE $00400000}
{$APPTYPE GUI}
program Project_Test1;

uses
  Forms,
  Unit1 in 'Unit1.pas' {Form1};

{$R *.RES}

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.
--------------------------------------------
{$A+,B-,C-,D-,E-,F-,G+,H+,I-,J+,K-,L-,M-,N+,O+,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y-,Z1}
{$MINSTACKSIZE $00004000}
{$MAXSTACKSIZE $00100000}
{$IMAGEBASE $00400000}
{$APPTYPE GUI}
unit Unit1;

interface
uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;

type
  TForm1 = class(TForm)
  private
  public
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

end.
 ------------------------------------------
 object Form1: TForm1
  Left = 330
  Top = 230
  Width = 696
  Height = 480
  Caption = 'Form1'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
end
-------------------------------------------
{$MINSTACKSIZE $00004000}
{$MAXSTACKSIZE $00100000}
{$IMAGEBASE $00400000}
{$APPTYPE GUI}
library DLL_test1;
uses
  SysUtils,
  Classes;

{$R *.RES}

begin
end.

0
Comment
Question by:Mutley2003
9 Comments
 
LVL 17

Expert Comment

by:mokule
ID: 12610435
Hi
You can do nothing to make them equal.
It only means that the runtime packeges has grown.
0
 

Author Comment

by:Mutley2003
ID: 12610937
I am not using runtime packages. I am fairly sure that in D7 I can get the D5 sizes. I can get the D5 size in D6 for the DLL by simply commenting out the uses clause. So it looks like a linker issue to me.

0
 
LVL 12

Expert Comment

by:Ivanov_G
ID: 12611977
In the source above for Unit1, I see you can remove some units - Dialogs, Graphics, Messages.

Once I checked check a DLL size in D3 and D6. Version 6 produced twice bigger executable, no matter what you do. Even if you build with runtime packages, it is again bigger. The reason for this is that Delphi internal units has grown. You can check in $Delphi/Lib folder about the size of SysUtils, Windows units in both Delphi 6 and 5 versions.

Just for comparison with D7:
SysUtils.dcu - 135 KB
Windows.dcu - 605 KB
Classes.dcu - 197 KB
Forms.dcu - 168 KB
Controls.dcu - 202 KB
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 17

Expert Comment

by:Wim ten Brink
ID: 12612986
There's a simple reason for the expansion... The Delphi libraries have grown a bit. More logic has been added to the VCL and this comes at a price: Bigger binaries.
Especially the Classes unit has a few more classes that all add to the additional overhead. Problem is, the smart compiler is unsure if it can strip certain classes from the final binary because they are actually used in other locations.

Just for comparison with D5:
SysUtils.dcu - 95 KB
Windows.dcu - 613 KB
Classes.dcu - 158 KB
Forms.dcu - 163 KB
Controls.dcu - 186 KB

If you compare these with Delphi 7 you will notice that the libraries have grown a bit. (Thanks, Ivanov_G) There are some developers who will even continue to use Delphi 2 because this Delphi version still produces the smallest executables. But the newest versions are a lot richer in abilities.

One thing you could try is use the sources of Delphi 5 to rebuild the libraries of Delphi 6 or 7. It would not suprise me if the executable sizes will become smaller again. The drawback however is the reduced functionality and furthermore, there's a risk of the Delphi IDE being too dependant of the version-related library. Thus, recompiling the Delphi 5 libraries with Delphi 7 could crash your IDE.
0
 

Author Comment

by:Mutley2003
ID: 12620515

Someone with a D7 compiler .. could you please cut and paste the above code and compile.
I am willing to bet (points, that is) that the resultant exes and dlls are SMALLER than the D6 ones.

Even better still, somone with a D6 compiler .. I'd like to confirm that you get the same exe and dll sizes I do. My D6 is upgrade pack 2.

thank you everyone

0
 
LVL 17

Expert Comment

by:mokule
ID: 12620595
Hi
D7 Pro Exe 368kb
0
 
LVL 17

Accepted Solution

by:
mokule earned 2000 total points
ID: 12620642
dll 87kb
D7 Pro not upgraded
0
 

Author Comment

by:Mutley2003
ID: 12630578
thanks mokule,

so it looks like the D6 linker is seriously unsmart for the DLL.  But maybe it is because of upgrade packs?

I am still wanting to see if anyone can reproduce my D6 results.

thanks
0
 

Expert Comment

by:Chaotikmind
ID: 12644437
If you really need tiny binaries , you should give a look at kol
http://xcl.cjb.net
This is a good replacement for base units and vcl , of course functionnality is reduced
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month19 days, 1 hour left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question