JDK-8366111 : Look into Clang -ftime-trace output
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: other
  • Priority: P4
  • Status: New
  • Resolution: Unresolved
  • Submitted: 2025-08-25
  • Updated: 2025-08-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Description
Clang provides some options to investigate compilation time. See "shenandoahOldGC.json" for an example. 

ClangBuildAnalyzer allows aggregating this data and extracting human-readable information from it. I attached an example output to this ticket (clang_build_analyzer.txt).

In JDK-8365053 I investigated the "Expensive headers" section. Other sections may be interesting to explore too to reduce build time.

**** Templates that took longest to instantiate:
 45007 ms: AccessInternal::OopLoadProxy<oopDesc *, 524288>::operator oopDesc * (1232 times, avg 36 ms)
 44433 ms: AccessInternal::load<524292UL, oopDesc *, oopDesc *> (1232 times, avg 36 ms)

**** Template sets that took longest to instantiate:
371271 ms: AccessInternal::BarrierResolver<$>::resolve_barrier (24728 times, avg 15 ms)
370278 ms: AccessInternal::BarrierResolver<$>::resolve_barrier_rt (24728 times, avg 14 ms)

**** Functions that took longest to compile:
  2550 ms: State::MachNodeGenerator(int) (/jdk/build/trace/hotspot/variant-server/gensrc/adfiles/ad_x86_gen.cpp)
  2539 ms: CompilerToVM::initialize_intrinsics(JVMCIEnv*) (/jdk/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp)

References:
- https://clang.llvm.org/docs/analyzer/developer-docs/PerformanceInvestigation.html
- https://github.com/aras-p/ClangBuildAnalyzer