Re: VarHandle instance methods performance

2019-04-26 Thread Martin Buchholz
I filed https://bugs.openjdk.java.net/browse/JDK-8223039

Re: VarHandle instance methods performance

2019-04-25 Thread Roger Riggs
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

RE: VarHandle instance methods performance

2019-04-25 Thread Frank Yuan
: "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/

Re: VarHandle instance methods performance

2019-04-25 Thread Martin Buchholz
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-

RE: VarHandle instance methods performance

2019-04-24 Thread Frank Yuan
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/

Re: VarHandle instance methods performance

2019-04-24 Thread Remi Forax
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

RE: VarHandle instance methods performance

2019-04-24 Thread Frank Yuan
> 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,

Re: VarHandle instance methods performance

2019-04-24 Thread Aleksey Shipilev
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