United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7039652 Performance regression after 7004547 changes
JDK-7039652 : Performance regression after 7004547 changes

Details
Type:
Bug
Submit Date:
2011-04-26
Status:
Closed
Updated Date:
2011-07-29
Project Name:
JDK
Resolved Date:
2011-05-16
Component:
hotspot
OS:
generic
Sub-Component:
compiler
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
hs21
Fixed Versions:
hs21 (b12)

Related Reports
Backport:
Relates:

Sub Tasks

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

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.
                                     
2011-04-26
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
                                     
2011-04-26
EVALUATION

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



Hardware and Software, Engineered to Work Together