Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v11]

2024-09-10 Thread Claes Redestad
On Mon, 9 Sep 2024 01:53:01 GMT, Shaojin Wen wrote: >> This is a follow-up to PR #20273, which improves performance when the number >> of parameters exceeds 20. >> >> When the number of parameters is large, the possibility of reuse will be >> lower, so we can use the static concat method and w

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v11]

2024-09-10 Thread duke
On Mon, 9 Sep 2024 01:53:01 GMT, Shaojin Wen wrote: >> This is a follow-up to PR #20273, which improves performance when the number >> of parameters exceeds 20. >> >> When the number of parameters is large, the possibility of reuse will be >> lower, so we can use the static concat method and w

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v11]

2024-09-09 Thread Chen Liang
On Mon, 9 Sep 2024 01:53:01 GMT, Shaojin Wen wrote: >> This is a follow-up to PR #20273, which improves performance when the number >> of parameters exceeds 20. >> >> When the number of parameters is large, the possibility of reuse will be >> lower, so we can use the static concat method and w

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v11]

2024-09-09 Thread Claes Redestad
On Mon, 9 Sep 2024 01:53:01 GMT, Shaojin Wen wrote: >> This is a follow-up to PR #20273, which improves performance when the number >> of parameters exceeds 20. >> >> When the number of parameters is large, the possibility of reuse will be >> lower, so we can use the static concat method and w

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v11]

2024-09-08 Thread Shaojin Wen
> This is a follow-up to PR #20273, which improves performance when the number > of parameters exceeds 20. > > When the number of parameters is large, the possibility of reuse will be > lower, so we can use the static concat method and write the length and coder > directly into the bytecode to

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v10]

2024-09-08 Thread Claes Redestad
On Sun, 8 Sep 2024 05:01:53 GMT, Shaojin Wen wrote: >> This is a follow-up to PR #20273, which improves performance when the number >> of parameters exceeds 20. >> >> When the number of parameters is large, the possibility of reuse will be >> lower, so we can use the static concat method and w

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v10]

2024-09-07 Thread Shaojin Wen
> This is a follow-up to PR #20273, which improves performance when the number > of parameters exceeds 20. > > When the number of parameters is large, the possibility of reuse will be > lower, so we can use the static concat method and write the length and coder > directly into the bytecode to

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v9]

2024-09-07 Thread ExE Boss
On Fri, 6 Sep 2024 19:33:09 GMT, Shaojin Wen wrote: >> This is a follow-up to PR #20273, which improves performance when the number >> of parameters exceeds 20. >> >> When the number of parameters is large, the possibility of reuse will be >> lower, so we can use the static concat method and w

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v9]

2024-09-06 Thread Shaojin Wen
> This is a follow-up to PR #20273, which improves performance when the number > of parameters exceeds 20. > > When the number of parameters is large, the possibility of reuse will be > lower, so we can use the static concat method and write the length and coder > directly into the bytecode to

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v8]

2024-09-06 Thread Chen Liang
On Fri, 6 Sep 2024 01:12:27 GMT, Shaojin Wen wrote: >> This is a follow-up to PR #20273, which improves performance when the number >> of parameters exceeds 20. >> >> When the number of parameters is large, the possibility of reuse will be >> lower, so we can use the static concat method and w

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v6]

2024-09-05 Thread Shaojin Wen
On Fri, 6 Sep 2024 01:01:11 GMT, Chen Liang wrote: >> Do I need to declare it as ACC_INTERFACE? Many utility classes do this. > > interface has extra restrictions that can fail class validation, such as > fields must be public static final. So I recommend just using abstract class. Thanks, I le

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v8]

2024-09-05 Thread Shaojin Wen
> This is a follow-up to PR #20273, which improves performance when the number > of parameters exceeds 20. > > When the number of parameters is large, the possibility of reuse will be > lower, so we can use the static concat method and write the length and coder > directly into the bytecode to

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v6]

2024-09-05 Thread Chen Liang
On Fri, 6 Sep 2024 00:45:14 GMT, Shaojin Wen wrote: >> src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java line >> 1288: >> >>> 1286: if (staticConcat) { >>> 1287: clb.withSuperclass(CD_Object) >>> 1288:

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v7]

2024-09-05 Thread Shaojin Wen
> This is a follow-up to PR #20273, which improves performance when the number > of parameters exceeds 20. > > When the number of parameters is large, the possibility of reuse will be > lower, so we can use the static concat method and write the length and coder > directly into the bytecode to

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v6]

2024-09-05 Thread Shaojin Wen
On Thu, 5 Sep 2024 23:37:30 GMT, Chen Liang wrote: >> Shaojin Wen has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 12 commits: >> >> - Merge remote-tracking branch 'upstream/master' into >> optim_concat_factory_202408 >> >>

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v6]

2024-09-05 Thread Chen Liang
On Thu, 5 Sep 2024 23:22:01 GMT, Shaojin Wen wrote: >> This is a follow-up to PR #20273, which improves performance when the number >> of parameters exceeds 20. >> >> When the number of parameters is large, the possibility of reuse will be >> lower, so we can use the static concat method and w

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v6]

2024-09-05 Thread Shaojin Wen
> This is a follow-up to PR #20273, which improves performance when the number > of parameters exceeds 20. > > When the number of parameters is large, the possibility of reuse will be > lower, so we can use the static concat method and write the length and coder > directly into the bytecode to

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v5]

2024-08-26 Thread Shaojin Wen
On Mon, 26 Aug 2024 22:25:49 GMT, Shaojin Wen wrote: >> This is a follow-up to PR #20273, which improves performance when the number >> of parameters exceeds 20. >> >> When the number of parameters is large, the possibility of reuse will be >> lower, so we can use the static concat method and

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v5]

2024-08-26 Thread Claes Redestad
On Mon, 26 Aug 2024 22:25:49 GMT, Shaojin Wen wrote: >> This is a follow-up to PR #20273, which improves performance when the number >> of parameters exceeds 20. >> >> When the number of parameters is large, the possibility of reuse will be >> lower, so we can use the static concat method and

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v5]

2024-08-26 Thread Shaojin Wen
On Mon, 26 Aug 2024 22:25:49 GMT, Shaojin Wen wrote: >> This is a follow-up to PR #20273, which improves performance when the number >> of parameters exceeds 20. >> >> When the number of parameters is large, the possibility of reuse will be >> lower, so we can use the static concat method and

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v5]

2024-08-26 Thread Claes Redestad
On Mon, 26 Aug 2024 22:29:03 GMT, Shaojin Wen wrote: > At this time, caching is an additional overhead, and it takes longer to reach > peak performance. Can you elaborate on this line of thinking? - PR Comment: https://git.openjdk.org/jdk/pull/20675#issuecomment-2311280698

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v5]

2024-08-26 Thread Shaojin Wen
On Mon, 26 Aug 2024 22:25:49 GMT, Shaojin Wen wrote: >> This is a follow-up to PR #20273, which improves performance when the number >> of parameters exceeds 20. >> >> When the number of parameters is large, the possibility of reuse will be >> lower, so we can use the static concat method and

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v5]

2024-08-26 Thread Shaojin Wen
> This is a follow-up to PR #20273, which improves performance when the number > of parameters exceeds 20. > > When the number of parameters is large, the possibility of reuse will be > lower, so we can use the static concat method and write the length and coder > directly into the bytecode to

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v4]

2024-08-26 Thread Claes Redestad
On Mon, 26 Aug 2024 20:51:35 GMT, Shaojin Wen wrote: >> This is a follow-up to PR #20273, which improves performance when the number >> of parameters exceeds 20. >> >> When the number of parameters is large, the possibility of reuse will be >> lower, so we can use the static concat method and

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v4]

2024-08-26 Thread Shaojin Wen
On Mon, 26 Aug 2024 20:51:35 GMT, Shaojin Wen wrote: >> This is a follow-up to PR #20273, which improves performance when the number >> of parameters exceeds 20. >> >> When the number of parameters is large, the possibility of reuse will be >> lower, so we can use the static concat method and

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v2]

2024-08-26 Thread Shaojin Wen
On Sun, 25 Aug 2024 13:10:41 GMT, Claes Redestad wrote: > > If the number of parameters is greater than 2, the probability of reuse may > > not be high. Using hard-coded constants can avoid the use of forceinline. > > I think this entirely depends on the application. Too low a threshold and >

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v4]

2024-08-26 Thread Shaojin Wen
> This is a follow-up to PR #20273, which improves performance when the number > of parameters exceeds 20. > > When the number of parameters is large, the possibility of reuse will be > lower, so we can use the static concat method and write the length and coder > directly into the bytecode to

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy

2024-08-26 Thread Claes Redestad
On Sun, 25 Aug 2024 22:03:56 GMT, Markus Karg wrote: > Could it be the case that you posted twice the exact same performance > numbers? I do not see any actual difference in your numbers. He did, then updated the numbers and posted this comment: > The same data is used in the diff section abov

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v2]

2024-08-25 Thread ExE Boss
On Sun, 25 Aug 2024 12:12:42 GMT, Shaojin Wen wrote: >> This is a follow-up to PR #20273, which improves performance when the number >> of parameters exceeds 20. >> >> When the number of parameters is large, the possibility of reuse will be >> lower, so we can use the static concat method and

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v3]

2024-08-25 Thread ExE Boss
On Sun, 25 Aug 2024 14:29:16 GMT, Shaojin Wen wrote: >> This is a follow-up to PR #20273, which improves performance when the number >> of parameters exceeds 20. >> >> When the number of parameters is large, the possibility of reuse will be >> lower, so we can use the static concat method and

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v3]

2024-08-25 Thread Shaojin Wen
> This is a follow-up to PR #20273, which improves performance when the number > of parameters exceeds 20. > > When the number of parameters is large, the possibility of reuse will be > lower, so we can use the static concat method and write the length and coder > directly into the bytecode to

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v2]

2024-08-25 Thread Claes Redestad
On Sun, 25 Aug 2024 12:54:08 GMT, Shaojin Wen wrote: > If the number of parameters is greater than 2, the probability of reuse may > not be high. Using hard-coded constants can avoid the use of forceinline. I think this entirely depends on the application. Too low a threshold and many applicat

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v2]

2024-08-25 Thread Shaojin Wen
On Sun, 25 Aug 2024 12:12:42 GMT, Shaojin Wen wrote: >> This is a follow-up to PR #20273, which improves performance when the number >> of parameters exceeds 20. >> >> When the number of parameters is large, the possibility of reuse will be >> lower, so we can use the static concat method and

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy

2024-08-25 Thread Claes Redestad
On Sun, 25 Aug 2024 12:13:34 GMT, Shaojin Wen wrote: > > * Can we try to optimize the default generation shape further before we > > reach for this sort of specialization? > > I am also thinking about this, such as the optimization of Integer/Long type > parameters. Is this what you are talkin

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy

2024-08-25 Thread Shaojin Wen
On Sun, 25 Aug 2024 11:25:11 GMT, Claes Redestad wrote: > * Can we try to optimize the default generation shape further before we reach > for this sort of specialization? I am also thinking about this, such as the optimization of Integer/Long type parameters. Is this what you are talking about

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v2]

2024-08-25 Thread Shaojin Wen
> This is a follow-up to PR #20273, which improves performance when the number > of parameters exceeds 20. > > When the number of parameters is large, the possibility of reuse will be > lower, so we can use the static concat method and write the length and coder > directly into the bytecode to