Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8213339

Update precompiled.hpp with headers based on current frequency

XMLWordPrintable

    • b19

      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

            ihse Magnus Ihse Bursie
            ihse Magnus Ihse Bursie
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: