ビルド時間を短縮化する2つのオプション
2015年11月6日
1つ目のコミットは広く効果が期待できるもので、
WITH_FAST_DEPENDのしくみ
2015年11月6日
FreeBSDではmake dependの段階でmkdep(1)コマンドを実行してビルドの依存関係データを生成しています。ビルドの依存関係データは対象となるソースコードが置かれているディレクトリに.dependという名前のファイルとして出力されます。make buildworldやmake buildkernelを実行したあとに/usr/
今回追加された機能はWITH_
ビルド時に依存関係データを出力する機能はGCC 3.
今回の追加では同機能はデフォルトでは無効化されていますが、
WITH_FAST_DEPENDベンチマーク
コミットにはWITH_
- CPU:2way Intel Xeon L5520@2.
27GHz (16論理コア) - メモリ:76Gバイト
- ディスク:ZFS 3-wayミラー
(SSD L2ARC/ LOG使用) - カーネル:WITNESSオプション含む
- ビルドオプション(x):-j20 WITH_
LLDB=yes WITH_ DEBUG_ FILES=yes - ビルドオプション(+):-j20 WITH_
LLDB=yes WITH_ DEBUG_ FILES=yes WITH_ FAST_ DEPEND=yes
x buildworld-before
+ buildworld-fastdep
+-------------------------------------------------------------------------------+
|+ |
|+ |
|+ xx x|
| |_MA___||
|A |
+-------------------------------------------------------------------------------+
N Min Max Median Avg Stddev
x 3 3744.13 3794.31 3752.25 3763.5633 26.935139
+ 3 3153.34 3155.16 3154.2 3154.2333 0.91045776
Difference at 95.0% confidence
-609.33 +/- 43.1943
-16.1902% +/- 1.1477%
(Student's t, pooled s = 19.0569)
x buildkernel-before
+ buildkernel-fastdep
+-------------------------------------------------------------------------------+
|+ x |
|++ xx|
| A||
|A| |
+-------------------------------------------------------------------------------+
N Min Max Median Avg Stddev
x 3 571.57 573.94 571.79 572.43333 1.3094401
+ 3 369.12 370.57 369.3 369.66333 0.79033748
Difference at 95.0% confidence
-202.77 +/- 2.45131
-35.4225% +/- 0.428227%
(Student's t, pooled s = 1.0815)
説明どおり、
WITH_CCACHE_BUILDのしくみ
WITH_
カーネルを書き換えるような開発をしている場合、
ccache(1)はこういったケースでキャッシュを効かせることでビルド時間の短縮を図るといったもので、
WITH_CCACHE_BUILDベンチマーク
WITH_
キャッシュが効いていない状態でWITH_
- ビルドオプション(x):-j20 with_
lldb=yes with_ debug_ files=yes - ビルドオプション(+):-j20 with_
lldb=yes with_ debug_ files=yes with_ ccache_ build=yes - ビルドオプション(*):-j20 with_
lldb=yes with_ debug_ files=yes with_ ccache_ build=yes - ビルドオプション(%):-j20 with_
lldb=yes with_ debug_ files=yes with_ ccache_ build=yes with_ fast_ depend=yes - ビルドオプション(#):-j20 with_
lldb=yes with_ debug_ files=yes with_ fast_ depend=yes
x buildworld-before
+ buildworld-ccache-empty
* buildworld-ccache-full
% buildworld-ccache-full-fastdep
# buildworld-fastdep
+-------------------------------------------------------------------------------+
|% * # +|
|% * # +|
|% * # xxx +|
| |A |
| A|
| A |
|A |
| A |
+-------------------------------------------------------------------------------+
N Min Max Median Avg Stddev
x 3 3744.13 3794.31 3752.25 3763.5633 26.935139
+ 3 4519 4525.04 4520.73 4521.59 3.1104823
Difference at 95.0% confidence
758.027 +/- 43.4565
20.1412% +/- 1.15466%
(Student's t, pooled s = 19.1726)
* 3 1823.08 1827.2 1825.62 1825.3 2.0785572
Difference at 95.0% confidence
-1938.26 +/- 43.298
-51.5007% +/- 1.15045%
(Student's t, pooled s = 19.1026)
% 3 1266.96 1279.37 1270.47 1272.2667 6.3971113
Difference at 95.0% confidence
-2491.3 +/- 44.3704
-66.1952% +/- 1.17895%
(Student's t, pooled s = 19.5758)
# 3 3153.34 3155.16 3154.2 3154.2333 0.91045776
Difference at 95.0% confidence
-609.33 +/- 43.1943
-16.1902% +/- 1.1477%
(Student's t, pooled s = 19.0569)
ビルドワールドではキャッシュが効いた状態で51%の高速化、
- ビルドオプション(x):-j20 with_
lldb=yes with_ debug_ files=yes - ビルドオプション(+):-j20 with_
lldb=yes with_ debug_ files=yes with_ ccache_ build=yes - ビルドオプション(*):-j20 with_
lldb=yes with_ debug_ files=yes with_ ccache_ build=yes - ビルドオプション(%):-j20 with_
lldb=yes with_ debug_ files=yes with_ ccache_ build=yes - ビルドオプション(#):-j20 with_
lldb=yes with_ debug_ files=yes with_ ccache_ build=yes with_ fast_ depend=yes - ビルドオプション(@):-j20 with_
lldb=yes with_ debug_ files=yes with_ fast_ depend=yes
x buildkernel-before
+ buildkernel-ccache-empty
* buildkernel-ccache-empty-fastdep
% buildkernel-ccache-full
# buildkernel-ccache-full-fastdep
@ buildkernel-fastdep
+-------------------------------------------------------------------------------+
|# @ % * |
|# @ % * x + |
|# @ % * xx ++|
| MA |
| MA|
| A |
| A |
|A |
| A |
+-------------------------------------------------------------------------------+
N Min Max Median Avg Stddev
x 3 571.57 573.94 571.79 572.43333 1.3094401
+ 3 727.97 731.91 728.06 729.31333 2.2492295
Difference at 95.0% confidence
156.88 +/- 4.17129
27.4058% +/- 0.728695%
(Student's t, pooled s = 1.84034)
* 3 527.1 528.29 528.08 527.82333 0.63516402
Difference at 95.0% confidence
-44.61 +/- 2.33254
-7.79305% +/- 0.407478%
(Student's t, pooled s = 1.02909)
% 3 400.4 401.05 400.62 400.69 0.3306055
Difference at 95.0% confidence
-171.743 +/- 2.16453
-30.0023% +/- 0.378128%
(Student's t, pooled s = 0.954969)
# 3 201.94 203.34 202.28 202.52 0.73020545
Difference at 95.0% confidence
-369.913 +/- 2.40293
-64.6212% +/- 0.419774%
(Student's t, pooled s = 1.06015)
@ 3 369.12 370.57 369.3 369.66333 0.79033748
Difference at 95.0% confidence
-202.77 +/- 2.45131
-35.4225% +/- 0.428227%
(Student's t, pooled s = 1.0815)
ビルドカーネルでも同様の傾向を見せています。キャッシュが効いた状態では30%の高速化、
知って得するオプション
ccache(1)を使ってビルドワールドやビルドカーネルの時間を短縮することはこれまでもできましたし、
WITH_
コミットされたのがCURRENTですので、
FreeBSD勉強会 告知
第46回 11月20日(金)19:00~ The Design and Implementation of the FreeBSD Operating System (2nd Edition) 読書会 第11回目 P.121 The scheduler implements round-robin…~
The Design and Implementation of the FreeBSD Operating System (2nd Edition)の読書会です。読書会11回目の今回はハードカバーでP.
第47回 12月22日(火)19:00~ ライトニングトーク×FreeBSD忘年会’15!
今やっていることがある、
後藤からは発表の冒頭、
