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

2023-11-26 Thread Tobias Hartmann
On Tue, 21 Nov 2023 21:03:20 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 [v6]

2023-11-21 Thread Sandhya Viswanathan
On Tue, 21 Nov 2023 21:03:20 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 full name >>Previous commit

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

2023-11-21 Thread Steve Dohrmann
> 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 > longer needed and has been removed from this pull request. See

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 full name >>Previous commit

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

2023-11-20 Thread Sandhya Viswanathan
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 and XorTest::copy is no >>

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/xor/XorOp.java line 10: > >> 8:

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 and XorTest::copy is no >>

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

2023-11-20 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

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

2023-11-20 Thread Jatin Bhateja
On Thu, 16 Nov 2023 21:26:47 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-1185G7,

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

2023-11-19 Thread Tobias Hartmann
On Thu, 16 Nov 2023 21:26:47 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-1185G7,

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

2023-11-19 Thread Tobias Hartmann
On Thu, 16 Nov 2023 21:26:47 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-1185G7,

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 following failure with > multiple

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

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

2023-11-16 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

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

2023-11-16 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

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-16 Thread Andrew Haley
On Thu, 16 Nov 2023 05:38:30 GMT, Jatin Bhateja 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.

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

2023-11-15 Thread Jatin Bhateja
On Wed, 15 Nov 2023 17:03:38 GMT, Steve Dohrmann wrote: >> Do you see any concerns while handling multithreaded case where writer is >> busy copying 256 bytes block in loop and reader try to access a location >> still not flushed out of write combining buffer. > > The results a concurrent

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

2023-11-15 Thread Jatin Bhateja
On Tue, 14 Nov 2023 07:59:22 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-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 Jatin Bhateja
On Wed, 15 Nov 2023 01:17:05 GMT, Steve Dohrmann wrote: >> @jatin-bhateja There is a sfence at line 781. > > Thanks, there is an store fence upon completion of the main loop for the > large size code: > >

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-14 Thread Sandhya Viswanathan
On Tue, 14 Nov 2023 08:09:28 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-14 Thread Jatin Bhateja
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-1185G7, which

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

2023-11-14 Thread Jatin Bhateja
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-1185G7, which

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-13 Thread Tobias Hartmann
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-1185G7, which

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-1185G7, which

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)