JDK-7039652 : Performance regression after 7004547 changes
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs21
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2011-04-26
  • Updated: 2011-07-29
  • Resolved: 2011-05-16
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.
JDK 7 Other
7Fixed hs21Fixed
Related Reports
Relates :  
Description
% bin/java -d64 VeryBranchyTest 200000
Warming up.....Warmup done.
0. time: 355
1. time: 356
2. time: 356
3. time: 355
4. time: 355
5. time: 356
6. time: 356
7. time: 356
8. time: 355
9. time: 355
10. time: 356
11. time: 356
avg time: 355.58334

After 7004535 fix:

% bin/java -d64 VeryBranchyTest 200000
Warming up.....Warmup done.
0. time: 450
1. time: 450
2. time: 450
3. time: 450
4. time: 451
5. time: 450
6. time: 450
7. time: 451
8. time: 450
9. time: 451
10. time: 450
11. time: 451
avg time: 450.33334

Comments
EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/ae93231c7a1f
29-04-2011

EVALUATION In the test case initial stride is -8 so the loop is unrolled only once 7004547 changes which moved next condition to the beginning of policy_unroll() method: // Check for stride being a small enough constant if (abs(cl->stride_con()) > (1<<3)) return false; Before 7004547 changes that check was done at the end of policy_unroll() and the method returned 'true' if there were a lot 'xor' nodes in the loop before the check. As result the loop in the test case was unrolled twice.
26-04-2011

WORK AROUND bin/java -d64 -XX:-UseLoopPredicate VeryBranchyTest 200000 VM option '-UseLoopPredicate' Warming up.....Warmup done. 0. time: 351 1. time: 352 2. time: 353 3. time: 351 4. time: 353 5. time: 353 6. time: 371 7. time: 355 8. time: 352 9. time: 352 10. time: 355 11. time: 353 avg time: 354.25
26-04-2011