Severe invokers performance drop from OpenJDK 7 to OpenJDK 8

Christian Thalinger christian.thalinger at oracle.com
Thu Oct 10 15:38:02 PDT 2013


Thanks for the report.  This seems to be a real issue and one of our engineers filed:

https://bugs.openjdk.java.net/browse/JDK-8026288

On Oct 10, 2013, at 1:32 AM, Julien Ponge <julien.ponge at gmail.com> wrote:

> Hello,
> 
> 
> 
> The runtime of Golo (http://golo-lang.org/) makes several uses of
> general invokers (MethodHandles.{invoker,exactInvoker}).
> 
> 
> 
> I noticed a severe performance drop when running code on OpenJDK 8.
> Perhaps this has something to do with the lambda form backend?
> 
> 
> 
> To give you an idea some of my micro-benchmarks stress call sites based
> on such invokers.
> 
> 
> 
>  * Under OpenJDK 7 or Oracle JDK 7 I get ~0.175s on a machine once the
>    JIT stabilises. It aligns with what you get with a static method
>    dispatch at an invokestatic call site.
>  * Under OpenJDK 8 I get ~0.75s in the same conditions, which is
>    severely slower.
> 
> 
> 
> I am not doing anything fancy in the Golo runtime, just dispatching
> calls where the first argument is method handle, and the remainder are
> arguments. One of such call sites bootstrap is as simple as:
> 
> 
> 
> public static CallSite bootstrap(MethodHandles.Lookup caller, String
> name, MethodType type) {
> 
>  return new
> ConstantCallSite(MethodHandles.invoker(type.dropParameterTypes(0, 1)));
> 
> }
> 
> 
> 
> // e.g., (MethodHandle mh, Object a, Object b) => mh.invoke(a, b)
> 
> 
> 
> Any idea?
> 
> 
> 
> - Julien



More information about the jdk8-dev mailing list