Unsafe vs MemorySegments / Bounds checking...

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Tue Nov 5 15:18:42 UTC 2024


On 05/11/2024 14:56, Ioannis Tsakpinis wrote:
>> It's a bit more complex than that, as that code really likes having a
>> single implementation for all the liveness checks - otherwise you get
>> bad profile pollution when multiple session kinds are involved. We're
>> working on a solution:
> Interesting, thanks!

I wonder if the PR mentioned there makes a difference, and shifts the 
scale towards the approach where a single static segment is used. I'm 
assuming that approach is not as sensitive to inlining as the other one?

Our benchmark (in the PR) show that we get much closer to Unsafe, 
although we can't fully eliminate the sign check (in the general case 
where the offset is truly random):

https://github.com/openjdk/jdk/pull/21810#issuecomment-2450511880

Maurizio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20241105/d9f19e54/attachment.htm>


More information about the panama-dev mailing list