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

Steve Dohrmann duke at openjdk.org
Thu Nov 16 17:00:33 UTC 2023


On Thu, 16 Nov 2023 09:49:00 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> 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?

One component of the included XorTest.xor benchmark is to read the bytes from two copied arrays.  See line 155 in libjnitest.c  
The nt stores are only used in the FOREGN LARGE case and it shows a net speedup  ~123 ms -> 104 ms.

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

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


More information about the hotspot-compiler-dev mailing list