RFR: JDK-8213339 Update precompiled.hpp with headers based on current frequency

Magnus Ihse Bursie magnus.ihse.bursie at oracle.com
Sat Nov 3 09:06:19 UTC 2018


The reasons for the current set of files included in precompiled.hpp is 
somewhat lost in the mists of history. However, it is clear that it is 
not optimal.

This patch replaces the current set with a new set, based on how often a 
header file is included in a C++ file. This selection contains all 
header files that are included by at least 130 C++ files. Testing has 
shown that this is around the optimal value -- include many more, and 
too many "innocent" files get hurt by unneeded work, leave out many 
more, and we miss out on optimization possibilities.

The same set turned out to work well for both clang and gcc. However, 
files named "*.inline.hpp" did hurt rather than help performance, so 
those have been left out. For visual studio, the same set was also 
optimal, as long as the inline files were included. Presumably, visual 
studio is better than gcc/clang on handling precompiled headers 
containing inlined code.

Here are some rough comparisons from our internal CI system, for 
building the target "hotspot" from scratch.

macosx-x64:
old: 00:05:00
new: 00:03:47

linux-x64:
old: 00:05:43
new: 00:04:51

windows-x64:
old: 00:05:18
new: 00:04:33

linux-aarch64:
old: 00:07:57
new: 00:03:48

Bug: https://bugs.openjdk.java.net/browse/JDK-8213339
WebRev: 
http://cr.openjdk.java.net/~ihse/JDK-8213339-update-precompiled-headers/webrev.01

/Magnus



More information about the build-dev mailing list