Re: RFR (XS) 8060485: (str) contentEquals checks the String contents twice on mismatch

2014-10-15 Thread Paul Sandoz
On Oct 15, 2014, at 10:57 AM, Paul Sandoz paul.san...@oracle.com wrote: Need a sponsor to push! I can do it later today. I knew i should of checked before hand, i see Alan has already pushed it, Pauk.

RFR (XS) 8060485: (str) contentEquals checks the String contents twice on mismatch

2014-10-14 Thread Aleksey Shipilev
Hi, Please review a trivial change in String.contentEquals: https://bugs.openjdk.java.net/browse/JDK-8060485 http://cr.openjdk.java.net/~shade/8060485/webrev.00/ It improves the performance drastically: http://cr.openjdk.java.net/~shade/8060485/perf.txt ...not to mention it improves the

Re: RFR (XS) 8060485: (str) contentEquals checks the String contents twice on mismatch

2014-10-14 Thread Martin Buchholz
Looks good to me! On Tue, Oct 14, 2014 at 9:05 AM, Aleksey Shipilev aleksey.shipi...@oracle.com wrote: Hi, Please review a trivial change in String.contentEquals: https://bugs.openjdk.java.net/browse/JDK-8060485 http://cr.openjdk.java.net/~shade/8060485/webrev.00/ It improves the

Re: RFR (XS) 8060485: (str) contentEquals checks the String contents twice on mismatch

2014-10-14 Thread Chris Hegarty
On 14 Oct 2014, at 17:33, Martin Buchholz marti...@google.com wrote: Looks good to me! +1 'noreg-hard' -Chris. On Tue, Oct 14, 2014 at 9:05 AM, Aleksey Shipilev aleksey.shipi...@oracle.com wrote: Hi, Please review a trivial change in String.contentEquals:

Re: RFR (XS) 8060485: (str) contentEquals checks the String contents twice on mismatch

2014-10-14 Thread Stanimir Simeonoff
Hi, This is an unrelated issue, yet is there any reason for the inner loop of equals to be written in such a (confusing) way? if (n == anotherString.value.length) { char v1[] = value; char v2[] = anotherString.value; int i = 0;

Re: RFR (XS) 8060485: (str) contentEquals checks the String contents twice on mismatch

2014-10-14 Thread Aleksey Shipilev
Thanks guys! And of course, I managed to do two minor mistakes in a two-line change: the indentation is a bit wrong, and cast to String is redundant. Here is the updated webrev and the changeset (need a Sponsor!): http://cr.openjdk.java.net/~shade/8060485/webrev.01/

Re: RFR (XS) 8060485: (str) contentEquals checks the String contents twice on mismatch

2014-10-14 Thread Aleksey Shipilev
On 14.10.2014 19:32, Stanimir Simeonoff wrote: Hi, This is an unrelated issue, yet is there any reason for the inner loop of equals to be written in such a (confusing) way? if (n == anotherString.value.length) { char v1[] = value; char v2[] =

Re: RFR (XS) 8060485: (str) contentEquals checks the String contents twice on mismatch

2014-10-14 Thread Alan Bateman
On 14/10/2014 18:38, Aleksey Shipilev wrote: Thanks guys! And of course, I managed to do two minor mistakes in a two-line change: the indentation is a bit wrong, and cast to String is redundant. Here is the updated webrev and the changeset (need a Sponsor!):

Re: RFR (XS) 8060485: (str) contentEquals checks the String contents twice on mismatch

2014-10-14 Thread Stanimir Simeonoff
a On Tue, Oct 14, 2014 at 10:55 PM, Alan Bateman alan.bate...@oracle.com wrote: On 14/10/2014 18:38, Aleksey Shipilev wrote: Thanks guys! And of course, I managed to do two minor mistakes in a two-line change: the indentation is a bit wrong, and cast to String is redundant. Here is the