I filed https://bugs.openjdk.java.net/browse/JDK-8223039
Hi Frank,
These performance measurements would be good to add as JMH tests in
open/test/micro...
Thanks, Roger
On 04/24/2019 05:51 AM, Frank Yuan wrote:
Hi Aleksey
I happened to see the performance to access a field by VarHandle API is much
worse than the native access.
I tested the
: "Aleksey Shipilev" mailto:sh...@redhat.com> >
> > Cc: "core-libs-dev" > <mailto:core-libs-dev@openjdk.java.net> >
> > Envoyé: Mercredi 24 Avril 2019 12:11:11
> > Objet: RE: VarHandle instance methods performance
>
> >> On 4/24/
gt; Thanks
> YC
>
>
> > it should be declared static (and final so it's a constant for the VM).
> >
> > Rémi
> >
> > - Mail original -
> > > De: "Frank Yuan"
> > > À: "Aleksey Shipilev"
> > > Cc: "core-
gt; - Mail original -
> > De: "Frank Yuan"
> > À: "Aleksey Shipilev"
> > Cc: "core-libs-dev"
> > Envoyé: Mercredi 24 Avril 2019 12:11:11
> > Objet: RE: VarHandle instance methods performance
>
> >> On 4/
class,
it should be declared static (and final so it's a constant for the VM).
Rémi
- Mail original -
> De: "Frank Yuan"
> À: "Aleksey Shipilev"
> Cc: "core-libs-dev"
> Envoyé: Mercredi 24 Avril 2019 12:11:11
> Objet: RE: VarHandle instanc
> 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,
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