(The synopsis is probably bad, please adjust if you think up something better)
This was found in much larger benchmark, and it affects JMH at 8u20+.
In short, after EliminateAutoBox was enabled in 8u20, users figure out the additional oddities in the performance scores, which is attributable to EliminateAutoBox stopping to work in surprising cases. E.g. these two methods will have drastically different performance:
@Benchmark
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public int basicHeap() {
int acc = 0;
for (int i = 0; i < count; i++) {
acc = acc ^ Integer.valueOf(data).hashCode();
}
return acc;
}
@Benchmark
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public int basicLocal() {
int d = data; // cache in local
int acc = 0;
for (int i = 0; i < count; i++) {
acc = acc ^ Integer.valueOf(d).hashCode();
}
return acc;
}
...which in the end suggests EliminateAutoBox failing in basicHeap case, and working fine in basicLocal case. Since our instance of JIRA is monospace-hostile, the rest of the analysis, as well as more benchmarks is here:
http://cr.openjdk.java.net/~shade/8055340/AutoBoxingFailsBenchmark.java
The runnable benchmark JAR is:
http://cr.openjdk.java.net/~shade/8055340/benchmarks.jar