Re: RFR: 8265237: String.join and StringJoiner can be improved further [v4]

2021-04-20 Thread Peter Levart
> While JDK-8148937 improved StringJoiner class by replacing internal use of > getChars that copies out characters from String elements into a char[] array > with StringBuilder which is somehow more optimal, the improvement was > marginal in speed (0% ... 10%) and mainly for smaller strings, whi

Re: RFR: 8265237: String.join and StringJoiner can be improved further [v3]

2021-04-19 Thread Roger Riggs
On Sun, 18 Apr 2021 19:55:20 GMT, Peter Levart wrote: >> While JDK-8148937 improved StringJoiner class by replacing internal use of >> getChars that copies out characters from String elements into a char[] array >> with StringBuilder which is somehow more optimal, the improvement was >> margin

Re: RFR: 8265237: String.join and StringJoiner can be improved further [v3]

2021-04-19 Thread Peter Levart
On Mon, 19 Apr 2021 10:44:04 GMT, Claes Redestad wrote: >> Peter Levart has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fix overflow checking logic, add test for it, avoid branch in loop, add >> 1-char strings to JHM test > > test/micro

Re: RFR: 8265237: String.join and StringJoiner can be improved further [v3]

2021-04-19 Thread Claes Redestad
On Sun, 18 Apr 2021 19:55:20 GMT, Peter Levart wrote: >> While JDK-8148937 improved StringJoiner class by replacing internal use of >> getChars that copies out characters from String elements into a char[] array >> with StringBuilder which is somehow more optimal, the improvement was >> margin

Re: RFR: 8265237: String.join and StringJoiner can be improved further [v2]

2021-04-18 Thread Peter Levart
On Fri, 16 Apr 2021 23:02:33 GMT, Peter Levart wrote: >> src/java.base/share/classes/java/lang/String.java line 3254: >> >>> 3252: >>> 3253: byte[] value = StringConcatHelper.newArray(((long) icoder << >>> 32) | llen); >>> 3254: int off = 0; >> >> StringConcatHelper.newArray()

Re: RFR: 8265237: String.join and StringJoiner can be improved further [v3]

2021-04-18 Thread Peter Levart
On Sun, 18 Apr 2021 19:55:20 GMT, Peter Levart wrote: >> While JDK-8148937 improved StringJoiner class by replacing internal use of >> getChars that copies out characters from String elements into a char[] array >> with StringBuilder which is somehow more optimal, the improvement was >> margin

Re: RFR: 8265237: String.join and StringJoiner can be improved further [v3]

2021-04-18 Thread Peter Levart
> While JDK-8148937 improved StringJoiner class by replacing internal use of > getChars that copies out characters from String elements into a char[] array > with StringBuilder which is somehow more optimal, the improvement was > marginal in speed (0% ... 10%) and mainly for smaller strings, whi

Re: RFR: 8265237: String.join and StringJoiner can be improved further [v2]

2021-04-17 Thread Tagir F . Valeev
On Thu, 15 Apr 2021 19:26:48 GMT, Peter Levart wrote: >> While JDK-8148937 improved StringJoiner class by replacing internal use of >> getChars that copies out characters from String elements into a char[] array >> with StringBuilder which is somehow more optimal, the improvement was >> margin

Re: RFR: 8265237: String.join and StringJoiner can be improved further [v2]

2021-04-16 Thread Peter Levart
On Fri, 16 Apr 2021 19:05:25 GMT, Roger Riggs wrote: >> Peter Levart has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add String.join benchmark method to StringJoinerBenchmark and adjust some >> parameters to cover bigger range > > src/j

Re: RFR: 8265237: String.join and StringJoiner can be improved further [v2]

2021-04-16 Thread Roger Riggs
On Thu, 15 Apr 2021 19:26:48 GMT, Peter Levart wrote: >> While JDK-8148937 improved StringJoiner class by replacing internal use of >> getChars that copies out characters from String elements into a char[] array >> with StringBuilder which is somehow more optimal, the improvement was >> margin

Re: RFR: 8265237: String.join and StringJoiner can be improved further

2021-04-15 Thread Peter Levart
On Wed, 14 Apr 2021 20:03:27 GMT, Claes Redestad wrote: > There's a StringJoinerBenchmark micro added by JDK-8148937 which could > perhaps be expanded with the scenarios you've experimented with here? I modified that micro benchmark and added a method to also measure String.join static method

Re: RFR: 8265237: String.join and StringJoiner can be improved further [v2]

2021-04-15 Thread Peter Levart
> While JDK-8148937 improved StringJoiner class by replacing internal use of > getChars that copies out characters from String elements into a char[] array > with StringBuilder which is somehow more optimal, the improvement was > marginal in speed (0% ... 10%) and mainly for smaller strings, whi

Re: RFR: 8265237: String.join and StringJoiner can be improved further

2021-04-15 Thread Florent Guillaume
On Wed, 14 Apr 2021 22:23:57 GMT, Peter Levart wrote: >> src/java.base/share/classes/java/lang/String.java line 3230: >> >>> 3228: >>> 3229: /** >>> 3230: * Designated join routine. >> >> Did you mean "dedicated"? > > No, I meant designated. It is the routine that all other public API

Re: RFR: 8265237: String.join and StringJoiner can be improved further

2021-04-14 Thread Peter Levart
On Wed, 14 Apr 2021 19:54:26 GMT, Florent Guillaume wrote: >> While JDK-8148937 improved StringJoiner class by replacing internal use of >> getChars that copies out characters from String elements into a char[] array >> with StringBuilder which is somehow more optimal, the improvement was >>

Re: RFR: 8265237: String.join and StringJoiner can be improved further

2021-04-14 Thread Claes Redestad
On Wed, 14 Apr 2021 18:58:57 GMT, Peter Levart wrote: > While JDK-8148937 improved StringJoiner class by replacing internal use of > getChars that copies out characters from String elements into a char[] array > with StringBuilder which is somehow more optimal, the improvement was > marginal i

Re: RFR: 8265237: String.join and StringJoiner can be improved further

2021-04-14 Thread Florent Guillaume
On Wed, 14 Apr 2021 18:58:57 GMT, Peter Levart wrote: > While JDK-8148937 improved StringJoiner class by replacing internal use of > getChars that copies out characters from String elements into a char[] array > with StringBuilder which is somehow more optimal, the improvement was > marginal i

Re: RFR: 8265237: String.join and StringJoiner can be improved further

2021-04-14 Thread Peter Levart
On Wed, 14 Apr 2021 18:58:57 GMT, Peter Levart wrote: > While JDK-8148937 improved StringJoiner class by replacing internal use of > getChars that copies out characters from String elements into a char[] array > with StringBuilder which is somehow more optimal, the improvement was > marginal i

RFR: 8265237: String.join and StringJoiner can be improved further

2021-04-14 Thread Peter Levart
While JDK-8148937 improved StringJoiner class by replacing internal use of getChars that copies out characters from String elements into a char[] array with StringBuilder which is somehow more optimal, the improvement was marginal in speed (0% ... 10%) and mainly for smaller strings, while GC wa