RFR: 8337237: Use FFM instead of Unsafe for Java 2D RenderBuffer class [v3]
Jayathirth D V
jdv at openjdk.org
Wed Aug 14 09:06:52 UTC 2024
On Mon, 29 Jul 2024 17:09:49 GMT, Phil Race <prr at openjdk.org> wrote:
>> Migrate from using Unsafe to FFM's MemorySegment API for allocating and setting native memory.
>> This code is used by Metal, OpenGL and D3D, so I manually tested SwingSet2 and J2Demo as well as running all the usual tests.
>> I also did some micro-benchmarking on the performance of Unsafe vs MemorySegment.
>> The performance of either is more than sufficient for us .. ie they could be 10x slower and we wouldn't even notice.
>> But they are in the same ballpark, and if one or the other is clearly faster it is the new FFM code.
>
> Phil Race has updated the pull request incrementally with one additional commit since the last revision:
>
> 8337237
There are no alignment issues while reading/writing into RenderBuffer, verified that by taking a look at individual Metal/OpenGL/D3D calls.
Also as captured we should not worry about performance impact of these calls as these are minute computations compared to actual rendering logic.
Latest change looks good to me.
-------------
Marked as reviewed by jdv (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/20339#pullrequestreview-2237576791
More information about the client-libs-dev
mailing list