On Thu, 3 Feb 2022 07:20:28 GMT, Aleksey Shipilev <sh...@openjdk.org> wrote:
> 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` This pull request has now been integrated. Changeset: fc772178 Author: Aleksey Shipilev <sh...@openjdk.org> URL: https://git.openjdk.java.net/jdk/commit/fc77217814eb1a346d7380299abdc2b01a69b4de Stats: 7 lines in 1 file changed: 5 ins; 0 del; 2 mod 8281168: Micro-optimize VarForm.getMemberName for interpreter Reviewed-by: redestad, vlivanov, mchung ------------- PR: https://git.openjdk.java.net/jdk/pull/7333