Difference between revisions of "File size and smartlinking/de"

From Free Pascal wiki
Jump to navigationJump to search
m
Line 9: Line 9:
 
<br />
 
<br />
 
== Case study 1 in Windows ==
 
== Case study 1 in Windows ==
 
+
Diese Studie wurde am 8. Februar 2006 durchgeführt. Da zu diesem Zeitpunkt Lazarus (Version 0.9.12) mit der Möglichkeit zum "smartlinking" kompiliert und freigegeben wurde. Diese Studie beschreibt die Beziehungen zwischen den unterschiedlichen Ergebnissen und den unterschiedlichen Lazarus und Free Pascal-Versionen mit und ohne der Verwedung von smartllinking.<br>
This study was conducted on the 8th of February 2006 because a Lazarus fully compiled with Smartlinking was Released (version 0.9.12). It intends to establish the relationship between the varying results below with different Lazarus and Free Pascal versions as well as with Smartlinking and without.
+
<br>
 
+
Die untersuchten Bedingungen:
 
+
* Die Grösse der ausführbaren Datei nach der Verwendung von strip
The Variables being studied are:
+
* Die Grösse der ausführbaren Datei nach der Verwendung von strip nach und der Verwendung von UPX
 
+
* Die Zeit, die für das Linken gebraucht wird
* Executable Größe nach strip
+
<br>
* Executable Größe nach strip und UPX
 
* Linking Zeit
 
 
 
  
 
Compile time isn´t considered here because it´s too similar on all configurations and much less significant than the link time.
 
Compile time isn´t considered here because it´s too similar on all configurations and much less significant than the link time.
Line 36: Line 33:
  
  
'''Ergebnisse'''
+
'''Results'''
  
  
Line 49: Line 46:
 
* Lazarus 0.9.13 snapshot. Free Pascal 2.1 that comes with the installer. The LCL is smartlinked. Refered from now on as simply 0.9.13 + 2.1 + SL.
 
* Lazarus 0.9.13 snapshot. Free Pascal 2.1 that comes with the installer. The LCL is smartlinked. Refered from now on as simply 0.9.13 + 2.1 + SL.
  
{| border=2 width="100%"
+
{| class="wikitable"
 
+
! !! 0.9.12 !! 0.9.13 + 2.0.2 !! 0.9.13 + 2.1 + SL !0.9.13 + 2.1
|-
 
!
 
! 0.9.12
 
! 0.9.13 + 2.0.2
 
! 0.9.13 + 2.1 + SL
 
! 0.9.13 + 2.1
 
 
 
 
|-
 
|-
 
! File Size after strip (in bytes)
 
! File Size after strip (in bytes)
| align="center" | 1108480
+
| align="center" | 1,108,480
| align="center" | 1587712
+
| align="center" | 1,587,712
| align="center" | 1425408
+
| align="center" | 1,425,408
| align="center" | 1649152
+
| align="center" | 1,649,152
  
 
|-
 
|-
 
! File Size after UPX (in bytes)
 
! File Size after UPX (in bytes)
| align="center" | 318976
+
| align="center" | 318,976
| align="center" | 438272
+
| align="center" | 438,272
| align="center" | 388608
+
| align="center" | 388,608
| align="center" | 454144
+
| align="center" | 454,144
  
 
|-
 
|-
Line 82: Line 72:
 
|}
 
|}
  
 +
[[Image:OuptutFileSizesComparisonChart.png]]
  
'''Fazit'''
+
'''Conclusion'''
  
  

Revision as of 09:20, 26 October 2014

Deutsch (de) English (en) français (fr) 日本語 (ja) português (pt) 中文(中国大陆)‎ (zh_CN)

Dieser Artikel befindet sich in Aufbau wie in Übersetzung. Helfen Sie mit, ihn weiter zu verbessern!

Einleitung

In Free Pascal entfernt die Compilereinstellung "Smart-Linkbar" bzw. "-CX" aus der ausführbaren Datei den nicht verwendeten Code und die nicht verwendeten Variablen.

Case study 1 in Windows

Diese Studie wurde am 8. Februar 2006 durchgeführt. Da zu diesem Zeitpunkt Lazarus (Version 0.9.12) mit der Möglichkeit zum "smartlinking" kompiliert und freigegeben wurde. Diese Studie beschreibt die Beziehungen zwischen den unterschiedlichen Ergebnissen und den unterschiedlichen Lazarus und Free Pascal-Versionen mit und ohne der Verwedung von smartllinking.

Die untersuchten Bedingungen:

  • Die Grösse der ausführbaren Datei nach der Verwendung von strip
  • Die Grösse der ausführbaren Datei nach der Verwendung von strip nach und der Verwendung von UPX
  • Die Zeit, die für das Linken gebraucht wird


Compile time isn´t considered here because it´s too similar on all configurations and much less significant than the link time.


Executable size without strip isn´t included. Notice that strip was used always from command line with the command:

strip --strip-all magnifier.exe


The program being compiled is the Virtual Magnifying Glass. The source and binaries for this program are freely available for download on: http://magnifier.sourceforge.net


About the linking time please note that the utilized computer is 3.2GHz Pentium 4 with Intel motherboard and dual core processor and 512MB of RAM.


Results


The utilized OS is Windows XP and the 0.9.13 versions are from the same date when 0.9.12 was release. The comparison took place using the following software configurations:

  • Lazarus 0.9.12 available here. Free Pascal 2.0.2 that comes with the installer. LCL and RTL are smartlinked. Refered from now on as simply 0.9.12.
  • Lazarus 0.9.13 downloaded from Subversion from the same date. Free Pascal 2.0.2 installed separately. The LCL is not smartlinked. Refered from now on as simply 0.9.13 + 2.0.2.
  • Lazarus 0.9.13 snapshot. Free Pascal 2.1 that comes with the installer. The LCL is not smartlinked. Refered from now on as simply 0.9.13 + 2.1.
  • Lazarus 0.9.13 snapshot. Free Pascal 2.1 that comes with the installer. The LCL is smartlinked. Refered from now on as simply 0.9.13 + 2.1 + SL.
0.9.12 0.9.13 + 2.0.2 0.9.13 + 2.1 + SL 0.9.13 + 2.1
File Size after strip (in bytes) 1,108,480 1,587,712 1,425,408 1,649,152
File Size after UPX (in bytes) 318,976 438,272 388,608 454,144
Linking time 15 seconds 5 seconds 45 seconds 10 seconds

OuptutFileSizesComparisonChart.png

Conclusion


The 0.9.13 snapshot from the 8th of February 2006 features a unstable compiler from the 2.1 branch, which can cause the bigger executables and slower linking time as compared to the other versions.


The 0.9.12 version has the best file size of all, both with UPX and without, showing that Smartlinking really can diminish the file size in Windows. This, however, does not come without a cost, and the cost is linking time, which is about 3 times higher then without smartlinking.


The 0.9.12 version already comes fully configured for Smartlinking on Windows and no extra configuration is needed. This was not the case on previous releases.

Siehe auch

  • Guide for anyone inexperienced in getting FPC and Lazarus to work properly.