VarHandle instance methods performance

Aleksey Shipilev shade at redhat.com
Wed Apr 24 10:03:34 UTC 2019


On 4/24/19 11:51 AM, Frank Yuan wrote:
> My test code is as below:
> ...
>     final VarHandle vhf;
>     final VarHandle vhvf;
> ...

Make these two "static final", initialize them in class initializer, then try again.

VarHandle (like Atomic*FieldUpdaters, MethodHandle, etc), have internal checks that can only be
folded away when the VH/MH/A*FU instance is constant.

-Aleksey



More information about the core-libs-dev mailing list