Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-31 Thread Claes Redestad
On Mon, 30 Aug 2021 11:49:49 GMT, Claes Redestad wrote: >> Refactor to improve inlining, which helps some microbenchmarks exer >> StringBuilder.append(String) > > Claes Redestad has updated the pull request incrementally with one additional > commit since the last revision: > > Simplify and

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Alan Bateman
On Mon, 30 Aug 2021 11:49:49 GMT, Claes Redestad wrote: >> Refactor to improve inlining, which helps some microbenchmarks exer >> StringBuilder.append(String) > > Claes Redestad has updated the pull request incrementally with one additional > commit since the last revision: > > Simplify and

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Roger Riggs
On Mon, 30 Aug 2021 11:49:49 GMT, Claes Redestad wrote: >> Refactor to improve inlining, which helps some microbenchmarks exer >> StringBuilder.append(String) > > Claes Redestad has updated the pull request incrementally with one additional > commit since the last revision: > > Simplify and

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Сергей Цыпанов
On Mon, 30 Aug 2021 14:52:12 GMT, Claes Redestad wrote: >> What about lines 582, 1003 and 1175? E.g. 582 >> >> public AbstractStringBuilder append(String str) { >> if (str == null) { >> return appendNull(); >> } >> int len = str.length(); >> ensureCapacityInternal(count +

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Сергей Цыпанов
On Mon, 30 Aug 2021 11:49:49 GMT, Claes Redestad wrote: >> Refactor to improve inlining, which helps some microbenchmarks exer >> StringBuilder.append(String) > > Claes Redestad has updated the pull request incrementally with one additional > commit since the last revision: > > Simplify and

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Claes Redestad
On Mon, 30 Aug 2021 14:26:23 GMT, Сергей Цыпанов wrote: >> No, I don't think so. The only use of this I can find is at line 1298 which >> effectively adds a substring: `putStringAt(dstOffset, (String) s, start, >> end);` > > What about lines 582, 1003 and 1175? E.g. 582 > > public AbstractStr

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Сергей Цыпанов
On Mon, 30 Aug 2021 13:54:13 GMT, Claes Redestad wrote: >> src/java.base/share/classes/java/lang/AbstractStringBuilder.java line 1730: >> >>> 1728: } >>> 1729: >>> 1730: private void putStringAt(int index, String str) { >> >> Can we replace all the calls to this method with calls to pr

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Claes Redestad
On Mon, 30 Aug 2021 13:35:23 GMT, Сергей Цыпанов wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Simplify and call getBytes(String, int, byte) when possible > > src/java.base/share/classes/java/lang/AbstractStri

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Сергей Цыпанов
On Mon, 30 Aug 2021 14:04:27 GMT, Claes Redestad wrote: >> src/java.base/share/classes/java/lang/AbstractStringBuilder.java line 1714: >> >>> 1712: >>> 1713: private void inflateIfNeededFor(String input) { >>> 1714: if (COMPACT_STRINGS && (coder != input.coder())) { >> >> I'm not c

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Claes Redestad
On Mon, 30 Aug 2021 13:29:56 GMT, Сергей Цыпанов wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Simplify and call getBytes(String, int, byte) when possible > > src/java.base/share/classes/java/lang/AbstractStri

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Сергей Цыпанов
On Mon, 30 Aug 2021 11:49:49 GMT, Claes Redestad wrote: >> Refactor to improve inlining, which helps some microbenchmarks exer >> StringBuilder.append(String) > > Claes Redestad has updated the pull request incrementally with one additional > commit since the last revision: > > Simplify and

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Сергей Цыпанов
On Mon, 30 Aug 2021 11:49:49 GMT, Claes Redestad wrote: >> Refactor to improve inlining, which helps some microbenchmarks exer >> StringBuilder.append(String) > > Claes Redestad has updated the pull request incrementally with one additional > commit since the last revision: > > Simplify and

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Claes Redestad
On Mon, 30 Aug 2021 13:15:20 GMT, Сергей Цыпанов wrote: > Hi, just curious how have you found out that the code should be extracted > into a separate methods? Profiler? I saw that `String::length` calls appeared more than once with async-profiler, then did some experiments to see if manually

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Сергей Цыпанов
On Mon, 30 Aug 2021 11:49:49 GMT, Claes Redestad wrote: >> Refactor to improve inlining, which helps some microbenchmarks exer >> StringBuilder.append(String) > > Claes Redestad has updated the pull request incrementally with one additional > commit since the last revision: > > Simplify and

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Claes Redestad
On Mon, 30 Aug 2021 11:49:49 GMT, Claes Redestad wrote: >> Refactor to improve inlining, which helps some microbenchmarks exer >> StringBuilder.append(String) > > Claes Redestad has updated the pull request incrementally with one additional > commit since the last revision: > > Simplify and

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Claes Redestad
> Refactor to improve inlining, which helps some microbenchmarks exer > StringBuilder.append(String) Claes Redestad has updated the pull request incrementally with one additional commit since the last revision: Simplify and call getBytes(String, int, byte) when possible - Change

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v2]

2021-08-30 Thread Claes Redestad
> Refactor to improve inlining, which helps some microbenchmarks exer > StringBuilder.append(String) Claes Redestad has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull requ

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings

2021-08-28 Thread Claes Redestad
On Sat, 28 Aug 2021 13:21:24 GMT, Claes Redestad wrote: > Refactor to improve inlining, which helps some microbenchmarks exer > StringBuilder.append(String) Microbenchmark results: Baseline BenchmarkMode CntScore Error Units # +CompactStrings StringBuilders.appendL

RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings

2021-08-28 Thread Claes Redestad
Refactor to improve inlining, which helps some microbenchmarks exer StringBuilder.append(String) - Commit messages: - 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings Changes: https://git.openjdk.java.net/jdk/pull/5291/files Webrev: https://webrevs.