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

Increase -inlinehint-threshold for Clang to avoid G1 pause time regression

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 13
    • Fix Version/s: 13
    • Component/s: hotspot
    • Subcomponent:
      gc
    • Resolved In Build:
      b19

      Description

      We observed a performance regression mainly in G1 pause time for Clang-built HotSpot, compared to GCC-built HotSpot. It is because Clang does not inline as much as GCC does, even for functions with "inline" keyword. As a result, some of G1's hottest functions for copying objects and evacuating regions have fewer inlined callees with Clang, leading to longer GC pauses.

      The easiest solution is to increase Clang's -inlinehint-threshold. A better long-term solution might be to identify those performance critical functions and mark them with ALWAYSINLINE macro instead of "inline" keyword.

      Attached is a performance experiment with DaCapo benchmarks for increasing -inlinehint-threshold to 100000, with normalized and unnormalized graphs. This patch (GoogClang-100kInline) reduces incremental collection pause time ("YG Pause Time (ms)") by up to 12% (xalan) for Clang-built HotSpot.

      Some more details below:

      Sizes of libjvm.so:
      GoogGcc-default: 25369007
      GoogClang-default: 22946876
      GoogClang-100kInline: 24681265

      GCC version: 4.9
      Clang version: trunk r355087
      # Clang must be newer than https://reviews.llvm.org/rL344987, so it can properly respect the "inline" keyword for function templates.

      Number of trials: 20
      The heap sizes are configured to relative small values (1.5X to 5X of the minimum heap size of each benchmark), so that G1 can trigger many collections.
      The graphs with "G1" as name prefix (e.g. "G1 YG Pause Time", "G1 Mixed Pause Time") are empty, because they rely on some hsperfdata counters that we added to G1 in our internal JDK. These counters do not exist in external OpenJDK yet.

        Attachments

          Activity

            People

            • Assignee:
              manc Man Cao
              Reporter:
              manc Man Cao
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: