JDK-8026288 : Performance regression in MethodHandles.invoker
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 8
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • Submitted: 2013-10-10
  • Updated: 2014-11-19
  • Resolved: 2014-06-25
Related Reports
Relates :  
Description
The initial report is from here:
http://mail.openjdk.java.net/pipermail/jdk8-dev/2013-October/003380.html

This regression manifests either with direct invoker call, or the invoker bootstrapped into the constant call site first. 

JDK 7u15:
50.909 +- 0.407 ops/us, o.o.p.ConstantCallSiteBench.baseline
50.217 +- 0.216 ops/us, o.o.p.ConstantCallSiteBench.testInvoker       
50.764 +- 0.836 ops/us, o.o.p.DirectBench.baseline       
29.211 +- 0.208 ops/us, o.o.p.DirectBench.testInvoker               

JDK 7u40:
57.386 +- 0.267 ops/us, o.o.p.ConstantCallSiteBench.baseline
  4.559 +- 0.082 ops/us, o.o.p.ConstantCallSiteBench.testInvoker       
54.099 +- 3.921 ops/us, o.o.p.DirectBench.baseline           
  4.197 +- 0.094 ops/us, o.o.p.DirectBench.testInvoker               

The benchmarks are available here (*.zip requires JMH to build, *.jar is executable JAR)
 http://cr.openjdk.java.net/~shade/8026288/
Comments
Shouldn't this be closed?
24-06-2014

Thanks Aleksey, filing on 7-pool for backport consideration.
14-05-2014

Nils, the regression is fixed in JDK 8 GA. The scores are similar to 8b115 in my previous comment.
14-05-2014

Please clarify if you consider this regression fixed in 8.
14-05-2014

JDK 8b115 yields much better performance: 53.724 +- 0.596 ops/us, o.o.p.ConstantCallSiteBench.baselineOrig 54.506 +- 0.204 ops/us, o.o.p.ConstantCallSiteBench.testInvoker 49.912 +- 0.382 ops/us, o.o.p.DirectBench.baselineOrig 27.595 +- 1.313 ops/us, o.o.p.DirectBench.testInvoker We might want to backport JDK-8024761 to JDK 7uX.
18-11-2013

The fix for JDK-8024761 makes a marked difference in this benchmark. Here are two runs of Aleksey's JAR file (single run, loaded system, zeroth-order approximation) - means with recent Java 8 code compiled just before 8024761 fix is applied + means with recent Java code 8 compiled just after 8024761 fix is applied = means historical Java 7 (u25) # means current Java 7 (u40) Benchmark Mode Thr Cnt Sec Mean Mean error Units -o.o.p.ConstantCallSiteBench.baselineOrig thrpt 1 5 1 53.872 18.062 ops/us -o.o.p.ConstantCallSiteBench.testInvoker thrpt 1 5 1 3.881 1.360 ops/us -o.o.p.DirectBench.baselineOrig thrpt 1 5 1 58.450 15.970 ops/us -o.o.p.DirectBench.testInvoker thrpt 1 5 1 2.857 1.038 ops/us +o.o.p.ConstantCallSiteBench.baselineOrig thrpt 1 5 1 56.758 11.098 ops/us +o.o.p.ConstantCallSiteBench.testInvoker thrpt 1 5 1 54.822 6.667 ops/us +o.o.p.DirectBench.baselineOrig thrpt 1 5 1 52.251 12.336 ops/us +o.o.p.DirectBench.testInvoker thrpt 1 5 1 29.824 7.990 ops/us =o.o.p.ConstantCallSiteBench.baselineOrig thrpt 1 5 1 53.549 8.444 ops/us =o.o.p.ConstantCallSiteBench.testInvoker thrpt 1 5 1 55.747 2.182 ops/us =o.o.p.DirectBench.baselineOrig thrpt 1 5 1 45.389 9.463 ops/us =o.o.p.DirectBench.testInvoker thrpt 1 5 1 31.815 4.483 ops/us #o.o.p.ConstantCallSiteBench.baselineOrig thrpt 1 5 1 66.415 2.734 ops/us #o.o.p.ConstantCallSiteBench.testInvoker thrpt 1 5 1 4.210 1.127 ops/us #o.o.p.DirectBench.baselineOrig thrpt 1 5 1 64.163 13.974 ops/us #o.o.p.DirectBench.testInvoker thrpt 1 5 1 4.053 0.436 ops/us
10-10-2013