Re: RFR: 8338937: Optimize the string concatenation of ClassDesc [v2]

2024-09-03 Thread Chen Liang
On Tue, 27 Aug 2024 11:52:38 GMT, Shaojin Wen wrote: >> The string concatenation of java.base module is implemented based on >> StringBuilder, which will result in extra object allocation and slow >> performance. We can solve this problem by using String.concat method and >> StringConcatHelper

Re: RFR: 8338937: Optimize the string concatenation of ClassDesc [v2]

2024-08-27 Thread Shaojin Wen
On Sun, 25 Aug 2024 21:41:11 GMT, Shaojin Wen wrote: >> Well, `Class​::descriptorString()` is referenced from the  >> `ReferenceClassDescImpl` creation code in `ConstantUtils`: >> https://github.com/openjdk/jdk/blob/5671f836039ef1683e3e9ce5b7cf0fa2f1860e2d/src/java.base/share/classes/jdk/internal

Re: RFR: 8338937: Optimize the string concatenation of ClassDesc [v2]

2024-08-27 Thread Shaojin Wen
> The string concatenation of java.base module is implemented based on > StringBuilder, which will result in extra object allocation and slow > performance. We can solve this problem by using String.concat method and > StringConcatHelper to provide concat method. > > for example, > > * use "+

Re: RFR: 8338937: Optimize the string concatenation of ClassDesc

2024-08-25 Thread Shaojin Wen
On Sun, 25 Aug 2024 21:29:17 GMT, ExE Boss wrote: >> In this case, there are too many locations under the java.lang package to >> change, and a new PR may be more appropriate. > > Well, `Class​::descriptorString()` is referenced from the  > `ReferenceClassDescImpl` creation code in `ConstantUtil

Re: RFR: 8338937: Optimize the string concatenation of ClassDesc

2024-08-25 Thread ExE Boss
On Sun, 25 Aug 2024 21:07:16 GMT, Shaojin Wen wrote: >> src/java.base/share/classes/java/lang/StringConcatHelper.java line 787: >> >>> 785: } >>> 786: >>> 787: static String concat(String prefix, String value, String suffix) { >> >> `Class​::descriptorString()` can probably also make u

Re: RFR: 8338937: Optimize the string concatenation of ClassDesc

2024-08-25 Thread Shaojin Wen
On Sun, 25 Aug 2024 16:55:23 GMT, ExE Boss wrote: >> Optimize ClassDesc related string concatenation, which will reduce object >> allocation during startup. > > src/java.base/share/classes/java/lang/StringConcatHelper.java line 787: > >> 785: } >> 786: >> 787: static String concat(Stri

Re: RFR: 8338937: Optimize the string concatenation of ClassDesc

2024-08-25 Thread ExE Boss
On Sun, 25 Aug 2024 13:36:34 GMT, Shaojin Wen wrote: > Optimize ClassDesc related string concatenation, which will reduce object > allocation during startup. src/java.base/share/classes/java/lang/StringConcatHelper.java line 787: > 785: } > 786: > 787: static String concat(String pref