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

C2: Clean up include statements to speed up compilation when touching type.hpp

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • 25
    • hotspot
    • b03

      I've noticed that after touching type.hpp in Valhalla, it requires more than 7 minutes to build hotspot. I would have suspected that we mostly recompile C2/opto source files. But that is far from the truth: A lot of unrelated source files must be recompiled, including, for example, C1, JFR, or runtime files.

      In mainline, the impact is not that severe. But it still requires around 1 minute to build hotspot again on my machine after touching type.hpp. I've had a look at the include chains and removed quite a lot of unused includes and moved some code around where one include pulled in a lot of unnecessary code. The mainline patch could also be applied to the current Valhalla repository (with some small tweaks).

      The results were quite promising. I could bring the compilation time significantly down in mainline and especially in Valhalla:
      - Mainline: ~1min -> ~40s (1.5 times faster)
      - Valhalla: ~7min -> ~40s (10.5 times faster)

      I've only focused on type.hpp here but I guess other includes in the JIT compiler area or other parts of hotspot could also be improved to speed up recompilation after touching some header files.

            chagedorn Christian Hagedorn
            chagedorn Christian Hagedorn
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: