RFR: 8339531: Improve performance of MemorySegment::mismatch

Maurizio Cimadamore mcimadamore at openjdk.org
Wed Sep 4 12:20:20 UTC 2024


On Wed, 4 Sep 2024 09:09:32 GMT, Per Minborg <pminborg at openjdk.org> wrote:

> This PR proposes to improve the performance of `MemorySegment::mismatch` by using Java code rather than transitioning to native code.

src/java.base/share/classes/jdk/internal/foreign/SegmentBulkOperations.java line 103:

> 101:         } else {
> 102:             long i;
> 103:             if (SCOPED_MEMORY_ACCESS.getByte(src.sessionImpl(), src.unsafeGetBase(), src.unsafeGetOffset() + srcToOffset) !=

Suggestion:

            if (SCOPED_MEMORY_ACCESS.getByte(src.sessionImpl(), src.unsafeGetBase(), src.unsafeGetOffset() + srcFromOffset) !=

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/20848#discussion_r1743672410


More information about the core-libs-dev mailing list