JDK-8350785 : C2: resource allocation verification slows C2 down by around 4%
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 24
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2025-02-26
  • Updated: 2025-03-07
  • Resolved: 2025-03-03
Related Reports
Causes :  
Duplicate :  
Description
The changes in JDK-8336999 introduced a regression of around 4% in C2 execution time across the DaCapo 23 benchmarks, see the detailed results in the attached spreadsheet.

The regression was found on linux-x64 by comparing C2's bytes/s as reported by -XX:+CITime (averaged over a number of repetitions) before and after the integration of JDK-8336999, using the JVM flags -Xbatch -XX:-TieredCompilation for stability.
Comments
Turns out the regression was already addressed by JDK-8343056 in JDK 24 (b22). Closing as duplicate.
03-03-2025

Thank you!
27-02-2025

Sure, I can give that a try, thanks!
27-02-2025

I think the problem is that I moved the following checks from the header files into the grow implementation: if( i>=Max() ) in Block_Array::map if( i>=_max ) in Node_Array::map if (_inode_top >= _inode_max) in Node_Stack::push if (word >= _size) inVectorSet::test_set and VectorSet::set The reason was that I always wanted to do the _nesting.check (even if no growing is required). I think we can simply move the checks back into the header and do the _nesting.check from there. [~rcastanedalo] would you have time to verify that this would solve the issue?
27-02-2025

Okay, maybe it's due to less inlining happening in the C++ code. ILW = Slowdown of C2 compilation (regression in JDK 24), measurable but not observed to affect overall application performance, no workaround = MLH = P4
27-02-2025

[~thartmann] No, unfortunately, I found the regression on a product build.
27-02-2025

[~rcastanedalo] Good catch! This is debug only, right?
27-02-2025