RFR: 8310159: Bulk copy with Unsafe::arrayCopy is slower compared to memcpy

Andrew Haley aph at openjdk.org
Thu Nov 16 09:51:32 UTC 2023


On Thu, 16 Nov 2023 05:38:30 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

>> The results a concurrent reader sees could be different if the copy is using nt writes, but if the read of the destination is not synced with the copy operation, I think the reader would not see consistent state in either case.  Is it worse with nt writes?
>
> Thanks for the clarification, agree behavior is similar to non-NT case, in fact using NT for huge copy operations will prevent polluting caches due to destination cache line fills.

But won't it also cause performance regressions in the common case where the caller needs to use the destination array?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16575#discussion_r1395431482


More information about the core-libs-dev mailing list