RFR(S): 8205194: Improve the Array Comparison when there is a mismatch at first element.
Deshpande, Vivek R
vivek.r.deshpande at intel.com
Tue Jun 19 17:16:43 UTC 2018
Thanks Paul for quick review. I will work on the things you have mentioned and get back soon.
I will also test this with test/jdk/java/util/Arrays/ArraysEqCmpTest.java.
Regards,
Vivek
From: Paul Sandoz [mailto:paul.sandoz at oracle.com]
Sent: Tuesday, June 19, 2018 9:55 AM
To: Deshpande, Vivek R <vivek.r.deshpande at intel.com>
Cc: David Holmes <david.holmes at oracle.com>; core-libs-dev at openjdk.java.net; Viswanathan, Sandhya <sandhya.viswanathan at intel.com>
Subject: Re: RFR(S): 8205194: Improve the Array Comparison when there is a mismatch at first element.
Hi Vivek,
Thanks for investigating this.
164 public static int mismatch(boolean[] a,
165 boolean[] b,
166 int length) {
167 int i = 0;
168 if (a[i] != b[i])
169 return i;
You might as well replace the use if i with 0 and i think you can move this to be performed when the length is greater than the threshold, that way you don’t impact small arrays below the threshold.
186 public static int mismatch(boolean[] a, int aFromIndex,
187 boolean[] b, int bFromIndex,
188 int length) {
189 int i = 0;
190 if (a[i] != b[i])
191 return i;
This is incorrect. You need to use aFromIndex and bFromIndex.
Do you run the test test/jdk/java/util/Arrays/ArraysEqCmpTest.java? If that passed then we need to strengthen for the case of a mismatch on the first relative element in each array.
Paul.
On Jun 19, 2018, at 9:36 AM, Deshpande, Vivek R <vivek.r.deshpande at intel.com<mailto:vivek.r.deshpande at intel.com>> wrote:
Thanks David.
Sending it to core-libs-dev.
I would like to contribute a patch which improves the array comparison when there is a mismatch for the first element.
This avoids call to vectorizedMismatch method and gives ~80x speed up.
Could you please review and sponsor the patch.
Link to bug:
https://bugs.openjdk.java.net/browse/JDK-8205194
webrev:
http://cr.openjdk.java.net/~vdeshpande/vectorizedMismatch_jdk/webrev.00/
Regards,
Vivek
-----Original Message-----
From: David Holmes [mailto:david.holmes at oracle.com]
Sent: Monday, June 18, 2018 10:32 PM
To: Deshpande, Vivek R <vivek.r.deshpande at intel.com<mailto:vivek.r.deshpande at intel.com>>; jdk-dev at openjdk.java.net<mailto:jdk-dev at openjdk.java.net>
Subject: Re: RFR(S): 8205194: Improve the Array Comparison when there is a mismatch at first element.
Hi Vivek,
Reviews should take place on the appropriate mailing list for the code being changed, not on the jdk-dev list. Please takes this to core-libs-dev.
Thanks,
David
On 19/06/2018 9:52 AM, Deshpande, Vivek R wrote:
Hi All
Forgot to add the links:
https://bugs.openjdk.java.net/browse/JDK-8205194
webrev:
http://cr.openjdk.java.net/~vdeshpande/vectorizedMismatch_jdk/webrev.0
0/
Regards.
Vivek
From: Deshpande, Vivek R
Sent: Monday, June 18, 2018 4:50 PM
To: 'jdk-dev at openjdk.java.net' <jdk-dev at openjdk.java.net<mailto:jdk-dev at openjdk.java.net>>
Cc: 'Paul Sandoz' <paul.sandoz at oracle.com<mailto:paul.sandoz at oracle.com>>; Viswanathan, Sandhya
<sandhya.viswanathan at intel.com<mailto:sandhya.viswanathan at intel.com>>
Subject: RFR(S): 8205194: Improve the Array Comparison when there is a mismatch at first element.
Hi All
I would like to contribute a patch which improves the array comparison when there is a mismatch for the first element.
This avoids call to vectorizedMismatch method and gives ~80x speed up.
Please review and sponsor the patch.
Regards,
Vivek
More information about the core-libs-dev
mailing list