-
Bug
-
Resolution: Fixed
-
P3
-
10, 11
FULL PRODUCT VERSION :
JDK 10, VM 10+46
FULL OS VERSION :
Microsoft Windows [Version 10.0.16299.309]
A DESCRIPTION OF THE PROBLEM :
32 bit integer dot product is no longer vectorised. This represents a performance regression.
THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Did not try
THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Yes
REGRESSION. Last worked in version 9.0.1
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the benchmark with JMH
EXPECTED VERSUS ACTUAL BEHAVIOR :
There should be similar performance between the two versions:
# JMH version: 1.19
# VM version: JDK 9.0.1, VM 9.0.1+11
Benchmark (size) Mode Cnt Score Error Units
DotProduct.dotProduct 1024 thrpt 10 2.998 ± 0.028 ops/us
# JMH version: 1.19
# VM version: JDK 10, VM 10+46
Benchmark (size) Mode Cnt Score Error Units
DotProduct.dotProduct 1024 thrpt 10 1.907 ± 0.063 ops/us
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import org.openjdk.jmh.annotations.*;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
@State(Scope.Thread)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public class DotProduct {
private int[] left;
private int[] right;
@Param({"1024"})
int size;
@Setup(Level.Trial)
public void init() {
left = new int[size];
right = new int[size];
for (int i = 0; i < size; ++i) {
left[i] = ThreadLocalRandom.current().nextInt();
right[i] = ThreadLocalRandom.current().nextInt();
}
}
@Benchmark
public int dotProduct() {
int dp = 0;
for (int i = 0; i < left.length && i < right.length; ++i) {
dp += left[i] * right[i ];
}
return dp;
}
}
---------- END SOURCE ----------
JDK 10, VM 10+46
FULL OS VERSION :
Microsoft Windows [Version 10.0.16299.309]
A DESCRIPTION OF THE PROBLEM :
32 bit integer dot product is no longer vectorised. This represents a performance regression.
THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Did not try
THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Yes
REGRESSION. Last worked in version 9.0.1
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the benchmark with JMH
EXPECTED VERSUS ACTUAL BEHAVIOR :
There should be similar performance between the two versions:
# JMH version: 1.19
# VM version: JDK 9.0.1, VM 9.0.1+11
Benchmark (size) Mode Cnt Score Error Units
DotProduct.dotProduct 1024 thrpt 10 2.998 ± 0.028 ops/us
# JMH version: 1.19
# VM version: JDK 10, VM 10+46
Benchmark (size) Mode Cnt Score Error Units
DotProduct.dotProduct 1024 thrpt 10 1.907 ± 0.063 ops/us
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import org.openjdk.jmh.annotations.*;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
@State(Scope.Thread)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public class DotProduct {
private int[] left;
private int[] right;
@Param({"1024"})
int size;
@Setup(Level.Trial)
public void init() {
left = new int[size];
right = new int[size];
for (int i = 0; i < size; ++i) {
left[i] = ThreadLocalRandom.current().nextInt();
right[i] = ThreadLocalRandom.current().nextInt();
}
}
@Benchmark
public int dotProduct() {
int dp = 0;
for (int i = 0; i < left.length && i < right.length; ++i) {
dp += left[i] * right[i ];
}
return dp;
}
}
---------- END SOURCE ----------
- relates to
-
JDK-8230062 assert(i == p->size()-1) failed: must be last element of the pack
-
- Closed
-