Book Image

OpenJDK Cookbook

Book Image

OpenJDK Cookbook

Overview of this book

Table of Contents (20 chapters)
OpenJDK Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Using ccache to speed up the OpenJDK 8 build process


Besides the Java source code, the OpenJDK source repository contains a lot of native C and C++ source code. Native code compilation is much longer than Java and may take a lot of time. During development, the same code may be compiled multiple times with minor changes. Intermediate binary results for parts of the code may be completely equal between the compilations, but usually parts of the code are recompiled even if no changes are added in those parts. It is natural to expect a more clever approach to code recompiling from modern advanced compilation/linking toolchains.

The ccache tool provides such cleverness for native compilation. This tool caches the output of C/C++ compilation so that the next time, the same compilation can be avoided and the results can be taken from the cache. This can greatly speed up recompiling time. The detection is done by hashing different kinds of information that should be unique for the compilation, and...