Withdrawn: 8307149: MethodHandles.arrayConstructor can be cached

duke duke at openjdk.org
Fri Aug 25 12:56:21 UTC 2023


On Thu, 4 May 2023 23:29:17 GMT, Chen Liang <liach at openjdk.org> wrote:

> This patch migrates `MethodHandles::arrayConstructor`, added in Java 9 as a hotfix to the incorrect constructor found on arrays via Lookup, to share the array access caching features. The result is that calling `MethodHandles.arrayConstructor` to create method handles is much faster.
> 
> Oracle JDK 20:
> 
> Benchmark                                             Mode  Cnt   Score   Error  Units
> MethodHandlesArrayConstructor.createWithAnewarray     avgt   15   2.739 ± 0.058  ns/op
> MethodHandlesArrayConstructor.createWithMethodHandle  avgt   15   3.313 ± 0.041  ns/op
> MethodHandlesArrayConstructor.methodHandleCreation    avgt   15  61.874 ± 0.397  ns/op
> 
> 
> This patch:
> 
> Benchmark                                             Mode  Cnt  Score   Error  Units
> MethodHandlesArrayConstructor.createWithAnewarray     avgt   15  3.067 ± 0.026  ns/op
> MethodHandlesArrayConstructor.createWithMethodHandle  avgt   15  3.699 ± 0.042  ns/op
> MethodHandlesArrayConstructor.methodHandleCreation    avgt   15  1.447 ± 0.004  ns/op

This pull request has been closed without being integrated.

-------------

PR: https://git.openjdk.org/jdk/pull/13819


More information about the core-libs-dev mailing list