On Thu, 12 Sep 2024 10:54:47 GMT, Per Minborg <pminb...@openjdk.org> wrote:

>> This PR proposes to improve the performance of `MemorySegment::mismatch` by 
>> using Java code rather than transitioning to native code.
>
> Per Minborg has updated the pull request incrementally with two additional 
> commits since the last revision:
> 
>  - Fix yet another typo
>  - Fix typo

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

> 202:         // This gives about 20% performance increase for large values of 
> `length`.
> 203:         // On non-Aarch64 architectures, the unroll code will be 
> eliminated at compile time.
> 204:         if (Architecture.isAARCH64() && NATIVE_THRESHOLD_MISMATCH > 64) {

I'm a bit opposed to this - as it goes in the direction to add a lot of 
transient complexity when in reality the underlying issue is that aarch64 
mismatch intrinsics should be fixed. Tinkering with thresholds is borderline, 
but still acceptable - having different implementations one per platform starts 
to look "more wrong".

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

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

Reply via email to