Performance of memory var handles in hot loops

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Tue Apr 7 14:07:16 UTC 2020


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