File size and smartlinking/ja

From Lazarus wiki
Revision as of 14:09, 29 March 2006 by Saeka-jp (talk | contribs)
Jump to navigationJump to search

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

この記事はLazarus上で実行ファイルサイズとスマートリンクについての作業中のものです。自由にコントリビュートしてください。

This article is a work in progress about executable size and smartlinking on Lazarus. Feel free to contribute.

Introduction

Case study 1 in Windows

この研究はLazarusが完全にスマートリンクされ、0.9.12としてリリースコンパイルされた2006年2月8日におこなわれました。異なった環境のLazarusのスマートリンカのあるなしFreePascalのバージョンとの組み合わせで、いろいろな結果をひきおこしました。

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.

研究したいろんな条件は下記のようなものです。

  • strip後の実行ファイルサイズ
  • stripとUPX後の実行ファイルサイズ
  • リンク時間

The Variables being studied are:

  • Executable size after strip
  • Executable size after strip and UPX
  • Linking time

コンパイル時間はここでは考慮しませんでした。なぜなら、すべてのコンフィグレーションにおいて、リンク時間と比較して、さほど有意な違いがないからです。

stripなしの実行ファイルサイズについても比較しませんでした。stripはコマンドラインから、下記のコマンドでおこなうことに、注意してください。

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

コンパイルされるプログラムは「仮想の拡大鏡」です。このプログラムのソースとバイナリーは、自由に使っていただいて結構です。ダウンロードは、こちら: http://magnifier.sourceforge.net

リンク時間について利用したコンピュータは、インテルマザーボードと、3.2GHzのデュアルコアPentium4、512MBのRAMのものです。

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.


結果

利用したOSはWindows XP、そして、0.9.12がリリースされたときと同じ日の0.9.13のLazarusを利用しました。 この比較は以下のソフトウェアのコンフィグレーションで行われました:

  • hereで利用可能なLazarus 0.9.12と、そのインストーラで入る Free Pascal 2.0.2。LCLとRTLはスマートリンクされたものです。以降、これらを単に0.9.12とします。
  • 同じ日のサブバージョンとしてダウンロードできる Lazarus 0.9.13。FreePascal 2.0.2を別にインストールします。LCLはスマートリンクされていません。 以降、これらを単に 0.9.13+2.0.2とします。
  • Lazarus 0.9.13スナップショット。インストーラで一緒に入ってくる Free Pascal 2.1。LCLはスマートリンクされていません。以降、これらを単に 0.9.13+2.1とします。
  • Lazarus 0.9.13スナップショット。インストーラで一緒に入ってくる Free Pascal 2.1。LCLはスマートリンクされていません。以降、これらを単に 0.9.13+2.1とします。
  • Lazarus 0.9.13スナップショット。インストーラで一緒に入ってくる Free Pascal 2.1。LCLはスマートリンクされています。以降、これらを単に 0.9.13+2.1+SLとします。


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) 1108480 1587712 1425408 1649152
File Size after UPX (in bytes) 318976 438272 388608 454144
Linking time 15 seconds 5 seconds 45 seconds 10 seconds


結論

2006年2月8日の0.9.13スナップショットは、unstableな2.1ブランチからのコンパイラが特徴です。そのコンパイラは、他のバージョンと比べて大きめの実行ファイルと、リンクに時間がかかる原因になっています。 0.9.12は、UPXのあり、なしにかかわらず、すべてに対してファイルサイズが最適です。つまり、Smartlinkingは本当にWindowsにおけるファイルサイズを減少させることができる、ということを示しています。しかしながら、これは、リンク時間がかかる、という代償なしではおこなえません。スマートリンクなしよりも3倍の時間です。 0.9.12は、すでにSmartlinkingのためにWindowsで完全に設定されています。そして、どんな追加も必要ではありません。 これは以前のリリースでのそうではありませんでした。

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.

See Also

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