Foreign memory access hot loop benchmark

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Wed Nov 25 12:42:17 UTC 2020


I did some investigation, and, during the problematic benchmark we were 
hitting some inline thresholds, as evidenced by `-XX:PrintInlining`:

@ 92   jdk.incubator.foreign.MemoryAccess::getLongAtIndex (12 bytes)   
NodeCountInliningCutoff
@ 96   jdk.incubator.foreign.MemoryAccess::setLongAtIndex (13 bytes)   
NodeCountInliningCutoff
@ 111   jdk.incubator.foreign.MemoryAccess::getLongAtIndex (12 bytes)   
NodeCountInliningCutoff
@ 120   jdk.incubator.foreign.MemoryAccess::getLongAtIndex (12 bytes)   
NodeCountInliningCutoff
@ 124   jdk.incubator.foreign.MemoryAccess::setLongAtIndex (13 bytes)   
NodeCountInliningCutoff

The problem is that the static accessors in MemoryAccess are lacking a 
@ForceInline annotation. This is being addressed here:

https://github.com/openjdk/panama-foreign/pull/401

Thanks
Maurizio


On 25/11/2020 11:51, Maurizio Cimadamore wrote:
>
> On 24/11/2020 11:19, Antoine Chambille wrote:
>> If I look at the slow benchmark in detail, I observe that the first 
>> two warmups run at the expected speed, but then it slows down 20x. 
>> Very strange, it's almost as if some JIT optimization is suddenly 
>> turned off:
>
> This is something I've observed in the past as well, in some cases, 
> when playing with VH.
>
> We'll take a look.
>
> Thanks
> Maurizio
>


More information about the panama-dev mailing list