<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" href="moz-extension://aa8b6de7-3f78-465d-87c7-03091dbf00e6/vendor/textcomplete.css">
  </head>
  <body>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 19/11/2024 16:52, Brian S O'Neill
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:61c8a4e1-3124-4669-892a-3949f5b170aa@gmail.com">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.
      <br>
    </blockquote>
    <p>Ok, so I'd say that this tweak didn't help much - results seem
      more or less on par with what you had before. And, also on par
      with what reported here:<br>
    </p>
    <p><a class="moz-txt-link-freetext" href="https://github.com/openjdk/jdk/pull/21810#issuecomment-2450511880">https://github.com/openjdk/jdk/pull/21810#issuecomment-2450511880</a></p>
    <p>My intuition is that, in most cases, the liveness check is always
      hoisted away if access occurs in some kind of loop -- and so its
      cost is amortized.</p>
    <p>Liveness check becomes more important when considering a
      single-shot access (or very small loops):</p>
    <p><a class="moz-txt-link-freetext" href="https://github.com/openjdk/jdk/pull/21810#issue-2627210220">https://github.com/openjdk/jdk/pull/21810#issue-2627210220</a></p>
    <p>But that's probably not a fair represention of your code base,
      which is probably why you are not seeing a lot of upshot.</p>
    <p>Maurizio<br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <blockquote type="cite" cite="mid:61c8a4e1-3124-4669-892a-3949f5b170aa@gmail.com">
      <br>
      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.
      <br>
      <br>
      There's a few more experiments I want to try out.
      <br>
      <br>
      <br>
      On 2024-11-19 08:23 AM, Maurizio Cimadamore wrote:
      <br>
      <blockquote type="cite">Thanks Brian
        <br>
        <br>
        On 19/11/2024 15:35, Brian S O'Neill wrote:
        <br>
        <blockquote type="cite">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. </blockquote>
        I believe that's to be expected.
        <br>
        <blockquote type="cite">I just started running tests which
          access the (effectively) unbounded MemorySegment and will
          report back in about an hour.
          <br>
        </blockquote>
        <br>
        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 :) ).
        <br>
        <br>
        Maurizio
        <br>
        <br>
        <blockquote type="cite">
          <br>
          On 2024-11-19 06:42 AM, Maurizio Cimadamore wrote:
          <br>
          <blockquote type="cite">Hi,
            <br>
            some performance tweaks have landed in the JDK 24 early
            access build (build 24):
            <br>
            <br>
<a class="moz-txt-link-freetext" href="https://urldefense.com/v3/__https://jdk.java.net/24/__;!!ACWV5N9M2RV99hQ!PM1KvkakQk5XJ7ClEecm-f7zp5BUeBS-oZ2mkmzcJ9qMOwzwRlkdbz7hBc3IO-1Nvd4uTQw13xtekdKgJZueUQ$">https://urldefense.com/v3/__https://jdk.java.net/24/__;!!ACWV5N9M2RV99hQ!PM1KvkakQk5XJ7ClEecm-f7zp5BUeBS-oZ2mkmzcJ9qMOwzwRlkdbz7hBc3IO-1Nvd4uTQw13xtekdKgJZueUQ$</a>
            <br>
            They are:
            <br>
            <br>
            <a class="moz-txt-link-freetext" href="https://git.openjdk.org/jdk/pull/21764">https://git.openjdk.org/jdk/pull/21764</a>
            <br>
            <a class="moz-txt-link-freetext" href="https://git.openjdk.org/jdk/pull/21810">https://git.openjdk.org/jdk/pull/21810</a>
            <br>
            <br>
            The former contains some optimizations for `MemorySegment
            <br>
            <br>
            ` 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].
            <br>
            <br>
            As JDK 24 is moving closer to rampdown phase [3], it would
            be great to give such changes a try and report back.
            <br>
            <br>
            Cheers
            <br>
            Maurizio
            <br>
            <br>
            [1] - <a class="moz-txt-link-freetext" href="https://mail.openjdk.org/pipermail/panama-dev/2024">https://mail.openjdk.org/pipermail/panama-dev/2024</a>-
            October/020702.html
            <br>
            [2] - <a class="moz-txt-link-freetext" href="https://mail.openjdk.org/pipermail/panama-dev/2024">https://mail.openjdk.org/pipermail/panama-dev/2024</a>-
            October/020736.html
            <br>
            [3] - <a class="moz-txt-link-freetext" href="https://openjdk.org/projects/jdk/24/">https://openjdk.org/projects/jdk/24/</a>
            <br>
            <br>
            &#8203;
            <br>
            <br>
            &#8203;
            <br>
          </blockquote>
          <br>
        </blockquote>
      </blockquote>
      <br>
    </blockquote>
    <ul class="dropdown-menu textcomplete-dropdown" style="display: none; position: absolute; z-index: 1000;" contenteditable="false">
    </ul>
  </body>
</html>