MethodHandle performance with JMH
Sergey Tselovalnikov
sergeicelov at gmail.com
Mon Mar 17 15:57:43 UTC 2014
I'm sorry, you are absolutely right. I missed this moment, thank you very
much
2014-03-17 14:46 GMT+06:00 Aleksey Shipilev <aleksey.shipilev at oracle.com>:
> Hi,
>
> On 03/16/2014 12:29 PM, Sergey Tselovalnikov wrote:
> > I tried to measure performance of MethodHandle in comparison with
> > reflection, but get Exception, because jmh uses generated code.
>
> I don't think this statement is grounded in reality, because the stack
> trace you are getting originates the exception from your own benchmark
> method:
>
> java.lang.invoke.WrongMethodTypeException: cannot convert
> MethodHandle()Integer to (Object[])Object
> ...
> at
>
> ru.serce.jmh.ReflectionMethodStaticAccess.testMethodHandle(ReflectionMethodStaticAccess.java:72)
> ...
>
> > Test project:
> > https://github.com/SerCeMan/reflection-access-tests
> >
> > I run tests from the terminal with command:
> > mvn clean install && java -jar target/microbenchmarks.jar
> > ".*MethodStatic.*" -wi 5 -i 5 -f 1 > compiled.txt
>
> Apparently, the MethodHandle tests are not there; and history does not
> have any evidence of ReflectionMethodStaticAccess.testMethodHandleExact.
> But I can already see the problem: compiling signature-polymorphic MH
> tests with source/target 1.6 wouldn't work, make it 1.7.
>
> -Aleksey.
>
--
С уважением,
Сергей Целовальников
More information about the jmh-dev
mailing list