On Thu, 5 Sep 2024 17:51:35 GMT, Maurizio Cimadamore <mcimadam...@openjdk.org> 
wrote:

>> Per Minborg has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Fix errors in a benchmark
>
> src/java.base/share/classes/jdk/internal/foreign/SegmentBulkOperations.java 
> line 175:
> 
>> 173:         } else {
>> 174:             long i;
>> 175:             if (SCOPED_MEMORY_ACCESS.getByte(src.sessionImpl(), 
>> src.unsafeGetBase(), src.unsafeGetOffset() + srcFromOffset) !=
> 
> I looked at this the other day, and I couldn't immediately tell whether this 
> test is needed or not - shouldn't it be covered by the subsequent loop? Is it 
> a shortcut (but only for the first element) - how much does that buy really?

I think this is an escape hatch that may trigger for random contents. Depending 
on the use case, this may or may not pay off. Maybe we should define an input 
distribution for which performance should be tuned against.

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

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

Reply via email to