Compiler Cache とは何か?
compiler cache は、コンパイラの前段に位置するレイヤーで、ある入力集合に対する出力を記録し、同じ入力が再び現れたときにそれを再生します。cache キーはソース、コンパイラのバージョン、flag を捕捉するため、hit は実際のコンパイルが生成するものと一致することが保証されます。ccache や sccache といったツールがこの考え方を実装しています。
なぜ重要か
コンパイルは多くの場合 build の最も長い部分で、その大半は commit や runner をまたいで繰り返される作業です。正しい compiler cache は、その繰り返しの作業を安価なルックアップに変え、build 時間と CI コストの両方を縮小します。保証のすべては、出力を変えうるすべての入力をキーが含んでいることにかかっています。
関連ガイド
What Is ccache?ccache is a compiler cache for C and C++ that speeds rebuilds by reusing the output of earlier compilations o…
What Is sccache?sccache is a compiler cache that stores compilation outputs, including in shared cloud storage, so repeated c…
What Is a Remote Cache Backend?A remote cache backend is shared storage where build and test caches live so many machines and CI runs can re…