-
Enhancement
-
Resolution: Fixed
-
P4
-
None
MemorySegment::ofBuffer is a rather complex factory. It needs to check the type of the array underneath the MS, to then select the appropriate ByteBuffer implementation. This complex logic results in a very big method which fails to inline:
https://mail.openjdk.org/pipermail/panama-dev/2024-October/020702.html
We should investigate ways to make this a bit better. In the short term, perhaps, by forcing inlining of the factory. In the longer term by moving the construction logic in a virtual method in the ByteBuffer hierarchy (since each buffer would know how to do the mapping correctly).
https://mail.openjdk.org/pipermail/panama-dev/2024-October/020702.html
We should investigate ways to make this a bit better. In the short term, perhaps, by forcing inlining of the factory. In the longer term by moving the construction logic in a virtual method in the ByteBuffer hierarchy (since each buffer would know how to do the mapping correctly).
- links to
-
Commit(master) openjdk/jdk/f69b6016
-
Review(master) openjdk/jdk/21764