FFM performance tweaks
Brian S O'Neill
bronee at gmail.com
Tue Nov 19 16:52:22 UTC 2024
Using the VarHandle transform, it's 1.6% slower than the baseline
(unsafe), and when using an unbounded MemorySegment, it's 4.9% slower
than the baseline.
I've changed my testing methodology a bit, to average out the
variability. So these numbers cannot be compared against any previous
results I reported.
There's a few more experiments I want to try out.
On 2024-11-19 08:23 AM, Maurizio Cimadamore wrote:
> Thanks Brian
>
> On 19/11/2024 15:35, Brian S O'Neill wrote:
>> I've already been running some tests against build 24 to see what
>> affect pull 21810 has. Tests using the transformed VarHandle technique
>> didn't show much improvement.
> I believe that's to be expected.
>> I just started running tests which access the (effectively) unbounded
>> MemorySegment and will report back in about an hour.
>
> That would be the more interesting one, yes. That said, I'm kind of
> prepared not to see the gains in the synthetic benchmark to translate in
> bigger real world gains (but I'd be very happy to be wrong here :) ).
>
> Maurizio
>
>>
>> On 2024-11-19 06:42 AM, Maurizio Cimadamore wrote:
>>> Hi,
>>> some performance tweaks have landed in the JDK 24 early access build
>>> (build 24):
>>>
>>> https://jdk.java.net/24/
>>>
>>> They are:
>>>
>>> https://git.openjdk.org/jdk/pull/21764
>>> https://git.openjdk.org/jdk/pull/21810
>>>
>>> The former contains some optimizations for `MemorySegment
>>>
>>> ` which should improve scalarization - see [1]. The second contains
>>> an improvement to the way we perform the liveness check, which should
>>> make such check provably redundant for segments backed by the global
>>> arena. This should improve the performance of workarounds using an
>>> “everything” segment to access off-heap memory with minimal impact
>>> from bound checks [2].
>>>
>>> As JDK 24 is moving closer to rampdown phase [3], it would be great
>>> to give such changes a try and report back.
>>>
>>> Cheers
>>> Maurizio
>>>
>>> [1] - https://mail.openjdk.org/pipermail/panama-dev/2024-
>>> October/020702.html
>>> [2] - https://mail.openjdk.org/pipermail/panama-dev/2024-
>>> October/020736.html
>>> [3] - https://openjdk.org/projects/jdk/24/
>>>
>>>
>>>
>>>
>>
More information about the panama-dev
mailing list