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

2023-11-27 Thread Steve Dohrmann
On Wed, 8 Nov 2023 23:23:48 GMT, Steve Dohrmann wrote: > Update: the XorTest::xor results shown in this message used test code from PR > commit 7cc272e862791 which was based on Maurizio Cimadamore's commit > a788f066af17. The XorTest has since been updated and XorTest::copy is no

Re: RFR: 8310159: Bulk copy with Unsafe::arrayCopy is slower compared to memcpy [v5]

2023-11-21 Thread Steve Dohrmann
On Tue, 21 Nov 2023 01:14:49 GMT, Sandhya Viswanathan wrote: >> Steve Dohrmann has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains ten commits: >> >> - Merge branch 'master' into memcpy >> - Update f

Re: RFR: 8310159: Bulk copy with Unsafe::arrayCopy is slower compared to memcpy [v6]

2023-11-21 Thread Steve Dohrmann
> XorTest.xorREGION SMALL avgt 3064093872.804 ± > 599704.491 ns/op > XorTest.xorREGION MEDIUM avgt 3081544576.454 ± > 1406342.118 ns/op > XorTest.xorREGION LARGE avgt 30 90091424.883 ± > 775577.613 ns/op > X

Re: RFR: 8310159: Bulk copy with Unsafe::arrayCopy is slower compared to memcpy [v5]

2023-11-21 Thread Steve Dohrmann
On Tue, 21 Nov 2023 01:10:40 GMT, Sandhya Viswanathan wrote: >> Steve Dohrmann has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains ten commits: >> >> - Merge branch 'master' into memcpy >> - Update f

Re: RFR: 8310159: Bulk copy with Unsafe::arrayCopy is slower compared to memcpy [v4]

2023-11-20 Thread Steve Dohrmann
On Mon, 20 Nov 2023 07:27:12 GMT, Tobias Hartmann wrote: >> Steve Dohrmann has updated the pull request incrementally with one >> additional commit since the last revision: >> >> - fix whitespace error > > test/micro/org/openjdk/bench/java/lang/foreign/x

Re: RFR: 8310159: Bulk copy with Unsafe::arrayCopy is slower compared to memcpy [v5]

2023-11-20 Thread Steve Dohrmann
On Mon, 20 Nov 2023 22:50:19 GMT, Steve Dohrmann wrote: >> Update: the XorTest::xor results shown in this message used test code from >> PR commit 7cc272e862791 which was based on Maurizio Cimadamore's commit >> a788f066af17. The XorTest has since been updated

Re: RFR: 8310159: Bulk copy with Unsafe::arrayCopy is slower compared to memcpy [v5]

2023-11-20 Thread Steve Dohrmann
avgt 3058583884.930 ± > 375355.215 ns/op > XorTest.xor CRITICAL LARGE avgt 3060644832.949 ± > 588120.738 ns/op > XorTest.xor FOREIGN SMALL avgt 3073868679.405 ± > 819965.524 ns/op > XorTest.xor FOREIGN MEDIUM avgt 30

Re: RFR: 8310159: Bulk copy with Unsafe::arrayCopy is slower compared to memcpy [v4]

2023-11-16 Thread Steve Dohrmann
On Mon, 13 Nov 2023 08:36:44 GMT, Tobias Hartmann wrote: >> Steve Dohrmann has updated the pull request incrementally with one >> additional commit since the last revision: >> >> - fix whitespace error > > I submitted some quick testing and I'm seeing the foll

Re: RFR: 8310159: Bulk copy with Unsafe::arrayCopy is slower compared to memcpy [v4]

2023-11-16 Thread Steve Dohrmann
On Thu, 16 Nov 2023 05:43:11 GMT, Jatin Bhateja wrote: >> src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.cpp line 585: >> >>> 583: __ shlq(temp2, shift); >>> 584: __ cmpq(temp2, large_threshold); >>> 585: __ jcc(Assembler::greaterEqual, L_copy_large); >> >> Hi @steveatgh , Can

Re: RFR: 8310159: Bulk copy with Unsafe::arrayCopy is slower compared to memcpy [v4]

2023-11-16 Thread Steve Dohrmann
avgt 3058583884.930 ± > 375355.215 ns/op > XorTest.xor CRITICAL LARGE avgt 3060644832.949 ± > 588120.738 ns/op > XorTest.xor FOREIGN SMALL avgt 3073868679.405 ± > 819965.524 ns/op > XorTest.xor FOREIGN MEDIUM

Re: RFR: 8310159: Bulk copy with Unsafe::arrayCopy is slower compared to memcpy [v3]

2023-11-16 Thread Steve Dohrmann
avgt 3058583884.930 ± > 375355.215 ns/op > XorTest.xor CRITICAL LARGE avgt 3060644832.949 ± > 588120.738 ns/op > XorTest.xor FOREIGN SMALL avgt 3073868679.405 ± > 819965.524 ns/op > XorTest.xor FOREIGN MEDIUM avgt 30

Re: RFR: 8310159: Bulk copy with Unsafe::arrayCopy is slower compared to memcpy [v2]

2023-11-16 Thread Steve Dohrmann
avgt 3058583884.930 ± > 375355.215 ns/op > XorTest.xor CRITICAL LARGE avgt 3060644832.949 ± > 588120.738 ns/op > XorTest.xor FOREIGN SMALL avgt 3073868679.405 ± > 819965.524 ns/op > XorTest.xor FOREIGN MEDIUM

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

2023-11-16 Thread Steve Dohrmann
On Thu, 16 Nov 2023 09:49:00 GMT, Andrew Haley 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

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

2023-11-15 Thread Steve Dohrmann
On Wed, 15 Nov 2023 01:44:56 GMT, Jatin Bhateja wrote: >> Thanks, there is an store fence upon completion of the main loop for the >> large size code: >> >> ![image](https://github.com/openjdk/jdk/assets/3858882/3bcea3c6-3bda-458c-aa7c-29ed6010cde2) > > Do you see any concerns while handling

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

2023-11-14 Thread Steve Dohrmann
On Wed, 15 Nov 2023 00:39:29 GMT, Sandhya Viswanathan wrote: >> src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.cpp line 1186: >> >>> 1184: __ evmovntdquq(Address(dst, index, scale, offset + 0x40), xmm2, >>> Assembler::AVX_512bit); >>> 1185: __ evmovntdquq(Address(dst, index,

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

2023-11-14 Thread Steve Dohrmann
On Tue, 14 Nov 2023 08:00:13 GMT, Jatin Bhateja wrote: >> Below is baseline data collected using a modified version of the >> java.lang.foreign.xor micro benchmark referenced by @mcimadamore in the bug >> report. I collected data on an Ubuntu 22.04 laptop with a Tigerlake >> i7-1185G7,

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

2023-11-13 Thread Steve Dohrmann
On Mon, 13 Nov 2023 08:36:44 GMT, Tobias Hartmann wrote: >> Below is baseline data collected using a modified version of the >> java.lang.foreign.xor micro benchmark referenced by @mcimadamore in the bug >> report. I collected data on an Ubuntu 22.04 laptop with a Tigerlake >> i7-1185G7,

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

2023-11-09 Thread Steve Dohrmann
On Wed, 8 Nov 2023 23:23:48 GMT, Steve Dohrmann wrote: > Below is baseline data collected using a modified version of the > java.lang.foreign.xor micro benchmark referenced by @mcimadamore in the bug > report. I collected data on an Ubuntu 22.04 laptop with a Tigerlake > i7-1

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

2023-11-09 Thread Steve Dohrmann
Below is baseline data collected using a modified version of the java.lang.foreign.xor micro benchmark referenced by @mcimadamore in the bug report. I collected data on an Ubuntu 22.04 laptop with a Tigerlake i7-1185G7, which does support AVX512. Baseline data Benchmark (arrayKind)