RFR: 8339531: Improve performance of MemorySegment::mismatch

Chen Liang liach at openjdk.org
Wed Sep 4 14:47:19 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 49:

> 47: 
> 48:     // MISMATCH_NATIVE_THRESHOLD must be a power of two and should be greater than 2^3
> 49:     private static final long MISMATCH_NATIVE_THRESHOLD = 1 << 20;

Should we allow toggling this threshold via properties to allow using vectorizedMismatchLargeForBytes for small lengths, such as for testing or debugging?

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

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


More information about the core-libs-dev mailing list