Question about memorySegment with safepoint checks?
xichen liu
benrush0705 at gmail.com
Wed Oct 9 16:18:04 UTC 2024
I would like to raise a question regarding the use of `MemorySegment` for
pointer traversal in memory. I have noticed that when using `long` as a
loop condition variable for traversal, the JVM inserts safepoint checks,
which leads to an overall performance decrease. As a result, it seems that
developers are advised to manually convert the `long` variable to
an `int` type to avoid this issue.
While I am not an expert in this area, my own testing in GraalVM shows that
it is capable of achieving similar performance when using `long` in loops
with fewer iterations, comparable to using `int`, whereas C2 does not seem
to handle this as efficiently.
I recall that there has been some previous discussion on this issue, and I
would like to inquire about the current status of this matter. Could you
please provide any updates or insights on how this has been addressed?
Best regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20241010/5a76faa9/attachment.htm>
More information about the panama-dev
mailing list