Performance of memory var handles in hot loops

Antoine Chambille ach at activeviam.com
Tue Apr 7 16:34:00 UTC 2020


Thank you guys, I thought MemoryAddress::addOffset was the optimized case.

Let me try with an indexed var handle.

-Antoine



On Tue, Apr 7, 2020 at 4:07 PM Maurizio Cimadamore <
maurizio.cimadamore at oracle.com> wrote:

>
> On 07/04/2020 15:04, Maurizio Cimadamore wrote:
> > P.S.
> >
> > I'm also pretty sure that, while the code above can match Unsafe for
> > 'int' carriers, the alignment check introduced for other carriers
> > might cause some performance degradation. That's another performance
> > pothole we're aware of.
>
> This is not 100% correct - optimizations should work correctly for all
> carriers, assuming you use VarHandle::get or VarHandle::set. All other
> VarHandle access primitives will add extra alignment checks which might
> deteriorate performances.
>
> Maurizio
>
>


More information about the panama-dev mailing list