RFR: 8281168: Micro-optimize VarForm.getMemberName for interpreter [v2]

Aleksey Shipilev shade at openjdk.java.net
Tue Feb 8 17:11:45 UTC 2022


> I was looking for easy things to do to improve `java.lang.invoke` cold performance. One of the things is inlining `VarForm.getMemberName` a bit, so that interpreter does not have to call through `getMemberNameOrNull`.
> 
> There is direct VarHandle benchmark in our corpus:
> 
> 
> $ CONF=linux-x86_64-server-release make run-test TEST=micro:java.lang.invoke.VarHandleExact MICRO="TIME=200ms;WARMUP_TIME=200ms;VM_OPTIONS=-Xint"
> 
> Benchmark                                 Mode  Cnt     Score    Error  Units
> 
> # -Xint
> # Baseline
> VarHandleExact.exact_exactInvocation      avgt   30   714.041 ±  5.882  ns/op
> VarHandleExact.generic_exactInvocation    avgt   30   641.570 ± 11.681  ns/op
> VarHandleExact.generic_genericInvocation  avgt   30  1336.571 ± 11.873  ns/op
> 
> # -Xint
> # Patched
> VarHandleExact.exact_exactInvocation      avgt   30   678.495 ± 10.752  ns/op ; +5%
> VarHandleExact.generic_exactInvocation    avgt   30   573.320 ±  5.100  ns/op ; +11%
> VarHandleExact.generic_genericInvocation  avgt   30  1338.593 ± 14.275  ns/op 
> 
> # (server, default)
> # Baseline
> VarHandleExact.exact_exactInvocation      avgt   30   0.620 ± 0.079  ns/op
> VarHandleExact.generic_exactInvocation    avgt   30   0.602 ± 0.063  ns/op
> VarHandleExact.generic_genericInvocation  avgt   30  10.521 ± 0.065  ns/op
> 
> # (server, default)
> # Patched
> VarHandleExact.exact_exactInvocation      avgt   30   0.621 ± 0.070  ns/op
> VarHandleExact.generic_exactInvocation    avgt   30   0.601 ± 0.061  ns/op
> VarHandleExact.generic_genericInvocation  avgt   30  10.499 ± 0.070  ns/op
> 
> 
> Additional testing:
>  - [x] Linux x86_64 fastdebug `tier1`
>  - [x] Linux x86_64 fastdebug `tier2`
>  - [x] Linux x86_64 fastdebug `tier3`

Aleksey Shipilev has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:

 - Comment
 - Merge branch 'master' into JDK-8281168-int-varform
 - Fix

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/7333/files
  - new: https://git.openjdk.java.net/jdk/pull/7333/files/62028379..a84a4e7e

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7333&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7333&range=00-01

  Stats: 6290 lines in 289 files changed: 3892 ins; 1334 del; 1064 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7333.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7333/head:pull/7333

PR: https://git.openjdk.java.net/jdk/pull/7333


More information about the core-libs-dev mailing list