On Fri, 17 Feb 2023 09:58:54 GMT, Claes Redestad <redes...@openjdk.org> wrote:

> During work on #12453 @schlosna reported that `array.clone()` might 
> underperform `System.arraycopy` in microbenchmarks and I opted to go with 
> `arraycopy` throughout while investigating.
> 
> Testing on x86 (SandyBridge, AVX2) I observe no difference at all between the 
> setups. On aarch the only difference I can observe is that arraycopy seem 
> curiously slow for input size = 0, otherwise no statistically significant 
> difference. All tests ran on builds from JDK mainline and 21-b9.
> 
> Since the reported difference was small and mostly visible on very large 
> arrays I conclude that the maintainability win we get from using `clone()` is 
> preferable. I've added the microbenchmark provided by @schlosna here.

Thanks for reviewing

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

PR: https://git.openjdk.org/jdk/pull/12613

Reply via email to