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 foll
gt;
> > À: "Aleksey Shipilev" mailto:[email protected]> >
> > Cc: "core-libs-dev" > <mailto:[email protected]> >
> > Envoyé: Mercredi 24 Avril 2019 12:11:11
> > Objet: RE: VarHandle instance methods performance
>
> &g
ow.
>
> 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: &q
t;
> - 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
>
> >>
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 in
> 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
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 check