Re: RFR: 8336856: Optimize String Concat [v42]

2024-08-12 Thread Chen Liang
On Mon, 12 Aug 2024 17:44:50 GMT, Shaojin Wen wrote: >> This PR implements the same algorithm as the current generateMHInlineCopy >> based on bytecode to improve startup performance. > > Shaojin Wen has updated the pull request incrementally with one additional > commit since the last revision:

Re: RFR: 8336856: Optimize String Concat [v11]

2024-08-12 Thread Chen Liang
On Thu, 25 Jul 2024 00:43:09 GMT, Shaojin Wen wrote: >> The solution is to call `.erase()` on the input method handle, and call >> `viewAsType` on the result method handle. > > Sorry, I don't understand what you mean. The following code can't solve the > above build error > > > public static

Re: RFR: 8336856: Optimize String Concat [v41]

2024-08-12 Thread Chen Liang
On Mon, 12 Aug 2024 16:16:10 GMT, Shaojin Wen wrote: >> This PR implements the same algorithm as the current generateMHInlineCopy >> based on bytecode to improve startup performance. > > Shaojin Wen has updated the pull request incrementally with two additional > commits since the last revision

Re: RFR: 8336856: Optimize String Concat [v42]

2024-08-12 Thread Claes Redestad
On Mon, 12 Aug 2024 18:35:45 GMT, Shaojin Wen wrote: > Should we change the title of the PR to `Implementing an efficient string > concatenation hidden class strategy based on ClassFile API`? Yes, or something shorter like `"8336856: Efficient hidden class-based string concatenation strategy"`

Re: RFR: 8336856: Optimize String Concat [v42]

2024-08-12 Thread Shaojin Wen
On Mon, 12 Aug 2024 17:44:50 GMT, Shaojin Wen wrote: >> This PR implements the same algorithm as the current generateMHInlineCopy >> based on bytecode to improve startup performance. > > Shaojin Wen has updated the pull request incrementally with one additional > commit since the last revision:

Re: RFR: 8336856: Optimize String Concat [v42]

2024-08-12 Thread Shaojin Wen
> This PR implements the same algorithm as the current generateMHInlineCopy > based on bytecode to improve startup performance. Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: fix comments - Changes: - all: https://git

Re: RFR: 8336856: Optimize String Concat [v41]

2024-08-12 Thread Claes Redestad
On Mon, 12 Aug 2024 16:16:10 GMT, Shaojin Wen wrote: >> This PR implements the same algorithm as the current generateMHInlineCopy >> based on bytecode to improve startup performance. > > Shaojin Wen has updated the pull request incrementally with two additional > commits since the last revision

Re: RFR: 8336856: Optimize String Concat [v39]

2024-08-12 Thread Claes Redestad
On Mon, 12 Aug 2024 16:52:53 GMT, Shaojin Wen wrote: >> src/java.base/share/classes/java/lang/StringConcatHelper.java line 83: >> >>> 81: >>> 82: @ForceInline >>> 83: private final String concat(char value) { >> >> These mostly help avoid a bit of class spinning on startup, rig

Re: RFR: 8336856: Optimize String Concat [v39]

2024-08-12 Thread Shaojin Wen
On Mon, 12 Aug 2024 14:47:13 GMT, Claes Redestad wrote: >> Shaojin Wen has updated the pull request incrementally with one additional >> commit since the last revision: >> >> fix comments > > src/java.base/share/classes/java/lang/StringConcatHelper.java line 83: > >> 81: >> 82: @For

Re: RFR: 8336856: Optimize String Concat [v41]

2024-08-12 Thread Shaojin Wen
> This PR implements the same algorithm as the current generateMHInlineCopy > based on bytecode to improve startup performance. Shaojin Wen has updated the pull request incrementally with two additional commits since the last revision: - fix comments - remove unused code - Chang

Re: RFR: 8336856: Optimize String Concat [v40]

2024-08-12 Thread Shaojin Wen
> This PR implements the same algorithm as the current generateMHInlineCopy > based on bytecode to improve startup performance. Shaojin Wen has updated the pull request incrementally with four additional commits since the last revision: - Update src/java.base/share/classes/java/lang/invoke/Str

Re: RFR: 8336856: Optimize String Concat [v39]

2024-08-12 Thread Claes Redestad
On Thu, 8 Aug 2024 11:43:07 GMT, Shaojin Wen wrote: >> This PR implements the same algorithm as the current generateMHInlineCopy >> based on bytecode to improve startup performance. > > Shaojin Wen has updated the pull request incrementally with one additional > commit since the last revision:

Re: RFR: 8336856: Optimize String Concat [v39]

2024-08-12 Thread Claes Redestad
On Thu, 8 Aug 2024 11:43:07 GMT, Shaojin Wen wrote: >> This PR implements the same algorithm as the current generateMHInlineCopy >> based on bytecode to improve startup performance. > > Shaojin Wen has updated the pull request incrementally with one additional > commit since the last revision:

Re: RFR: 8336856: Optimize String Concat [v39]

2024-08-08 Thread Shaojin Wen
On Thu, 8 Aug 2024 11:43:07 GMT, Shaojin Wen wrote: >> This PR implements the same algorithm as the current generateMHInlineCopy >> based on bytecode to improve startup performance. > > Shaojin Wen has updated the pull request incrementally with one additional > commit since the last revision:

Re: RFR: 8336856: Optimize String Concat [v39]

2024-08-08 Thread Shaojin Wen
On Thu, 8 Aug 2024 11:43:07 GMT, Shaojin Wen wrote: >> This PR implements the same algorithm as the current generateMHInlineCopy >> based on bytecode to improve startup performance. > > Shaojin Wen has updated the pull request incrementally with one additional > commit since the last revision:

Re: RFR: 8336856: Optimize String Concat [v39]

2024-08-08 Thread Shaojin Wen
> This PR implements the same algorithm as the current generateMHInlineCopy > based on bytecode to improve startup performance. Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: fix comments - Changes: - all: https://git

Re: RFR: 8336856: Optimize String Concat [v38]

2024-08-08 Thread Shaojin Wen
> This PR implements the same algorithm as the current generateMHInlineCopy > based on bytecode to improve startup performance. Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: fix comments - Changes: - all: https://git

Re: RFR: 8336856: Optimize String Concat [v37]

2024-08-06 Thread Shaojin Wen
> This PR implements the same algorithm as the current generateMHInlineCopy > based on bytecode to improve startup performance. Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: 1. not generate coderArgs unless needed 2. code style -

Re: RFR: 8336856: Optimize String Concat [v36]

2024-08-06 Thread Shaojin Wen
> This PR implements the same algorithm as the current generateMHInlineCopy > based on bytecode to improve startup performance. Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: refactor checkOverflow - Changes: - all: h

Re: RFR: 8336856: Optimize String Concat [v35]

2024-08-06 Thread Claes Redestad
On Tue, 6 Aug 2024 23:41:09 GMT, Shaojin Wen wrote: >> This PR implements the same algorithm as the current generateMHInlineCopy >> based on bytecode to improve startup performance. > > Shaojin Wen has updated the pull request incrementally with six additional > commits since the last revision:

Re: RFR: 8336856: Optimize String Concat [v35]

2024-08-06 Thread Shaojin Wen
On Tue, 6 Aug 2024 23:41:09 GMT, Shaojin Wen wrote: >> This PR implements the same algorithm as the current generateMHInlineCopy >> based on bytecode to improve startup performance. > > Shaojin Wen has updated the pull request incrementally with six additional > commits since the last revision:

Re: RFR: 8336856: Optimize String Concat [v35]

2024-08-06 Thread Shaojin Wen
> This PR implements the same algorithm as the current generateMHInlineCopy > based on bytecode to improve startup performance. Shaojin Wen has updated the pull request incrementally with six additional commits since the last revision: - checkOverflow - highArity default 0 - use MethodTypeDe

Re: RFR: 8336856: Optimize String Concat [v34]

2024-08-06 Thread Claes Redestad
On Tue, 6 Aug 2024 18:07:16 GMT, Shaojin Wen wrote: >> This PR implements the same algorithm as the current generateMHInlineCopy >> based on bytecode to improve startup performance. > > Shaojin Wen has updated the pull request incrementally with two additional > commits since the last revision:

Re: RFR: 8336856: Optimize String Concat [v34]

2024-08-06 Thread Claes Redestad
On Tue, 6 Aug 2024 18:07:16 GMT, Shaojin Wen wrote: >> This PR implements the same algorithm as the current generateMHInlineCopy >> based on bytecode to improve startup performance. > > Shaojin Wen has updated the pull request incrementally with two additional > commits since the last revision:

Re: RFR: 8336856: Optimize String Concat [v34]

2024-08-06 Thread Shaojin Wen
On Tue, 6 Aug 2024 18:07:16 GMT, Shaojin Wen wrote: >> This PR implements the same algorithm as the current generateMHInlineCopy >> based on bytecode to improve startup performance. > > Shaojin Wen has updated the pull request incrementally with two additional > commits since the last revision:

Re: RFR: 8336856: Optimize String Concat [v34]

2024-08-06 Thread Shaojin Wen
> This PR implements the same algorithm as the current generateMHInlineCopy > based on bytecode to improve startup performance. Shaojin Wen has updated the pull request incrementally with two additional commits since the last revision: - copyright - remove unused import - Change

Re: RFR: 8336856: Optimize String Concat [v33]

2024-08-06 Thread Shaojin Wen
> This PR implements the same algorithm as the current generateMHInlineCopy > based on bytecode to improve startup performance. Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: resolve the WithSecurityManager test failure

Re: RFR: 8336856: Optimize String Concat [v32]

2024-08-06 Thread Claes Redestad
On Tue, 6 Aug 2024 17:01:11 GMT, Shaojin Wen wrote: >> This PR implements the same algorithm as the current generateMHInlineCopy >> based on bytecode to improve startup performance. > > Shaojin Wen has updated the pull request incrementally with one additional > commit since the last revision:

Re: RFR: 8336856: Optimize String Concat [v32]

2024-08-06 Thread Shaojin Wen
> This PR implements the same algorithm as the current generateMHInlineCopy > based on bytecode to improve startup performance. Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: fix comments & code style - Changes: - all

Re: RFR: 8336856: Optimize String Concat [v31]

2024-08-05 Thread Shaojin Wen
> This PR implements the same algorithm as the current generateMHInlineCopy > based on bytecode to improve startup performance. Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: typo - Changes: - all: https://git.openjdk

Re: RFR: 8336856: Optimize String Concat [v30]

2024-08-05 Thread Shaojin Wen
> This PR implements the same algorithm as the current generateMHInlineCopy > based on bytecode to improve startup performance. Shaojin Wen has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 93 commits: - Merge remote-tracking branch '

Re: RFR: 8336856: Optimize String Concat [v29]

2024-08-04 Thread Shaojin Wen
> This PR implements the same algorithm as the current generateMHInlineCopy > based on bytecode to improve startup performance. Shaojin Wen has updated the pull request incrementally with four additional commits since the last revision: - copyright - add comments & code style & make code clea

Re: RFR: 8336856: Optimize String Concat [v28]

2024-08-04 Thread Shaojin Wen
On Sun, 4 Aug 2024 16:09:08 GMT, Shaojin Wen wrote: >> This PR implements the same algorithm as the current generateMHInlineCopy >> based on bytecode to improve startup performance. > > Shaojin Wen has updated the pull request incrementally with 11 additional > commits since the last revision:

Re: RFR: 8336856: Optimize String Concat [v28]

2024-08-04 Thread Shaojin Wen
> This PR implements the same algorithm as the current generateMHInlineCopy > based on bytecode to improve startup performance. Shaojin Wen has updated the pull request incrementally with 11 additional commits since the last revision: - 1. split length & coder & prepend method 2. fix commen

Re: RFR: 8336856: Optimize String Concat [v27]

2024-08-03 Thread Shaojin Wen
> This PR implements the same algorithm as the current generateMHInlineCopy > based on bytecode to improve startup performance. Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: remove lengthcoder - Changes: - all: https

Re: RFR: 8336856: Optimize String Concat [v26]

2024-08-02 Thread Shaojin Wen
> This PR implements the same algorithm as the current generateMHInlineCopy > based on bytecode to improve startup performance. Shaojin Wen has updated the pull request incrementally with 14 additional commits since the last revision: - Merge pull request #9 from cl4es/pr_20273_inject_cache

Re: RFR: 8336856: Optimize String Concat [v25]

2024-08-01 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8336856: Optimize String Concat [v24]

2024-08-01 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8336856: Optimize String Concat [v23]

2024-08-01 Thread Chen Liang
On Fri, 2 Aug 2024 00:59:06 GMT, Shaojin Wen wrote: >> The current implementation of StringConcat is to mix the coder and length >> into a long. This operation will have some overhead for int/long/boolean >> types. We can separate the calculation of the coder from the calculation of >> the len

Re: RFR: 8336856: Optimize String Concat [v23]

2024-08-01 Thread Shaojin Wen
On Fri, 2 Aug 2024 01:04:08 GMT, Claes Redestad wrote: >> Shaojin Wen has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fix performance regression caused by args.erase() > > I think erasing arguments is needed for correctness - are you sur

Re: RFR: 8336856: Optimize String Concat [v23]

2024-08-01 Thread Shaojin Wen
On Fri, 2 Aug 2024 00:59:06 GMT, Shaojin Wen wrote: >> The current implementation of StringConcat is to mix the coder and length >> into a long. This operation will have some overhead for int/long/boolean >> types. We can separate the calculation of the coder from the calculation of >> the len

Re: RFR: 8336856: Optimize String Concat [v23]

2024-08-01 Thread Shaojin Wen
On Fri, 2 Aug 2024 00:59:06 GMT, Shaojin Wen wrote: >> The current implementation of StringConcat is to mix the coder and length >> into a long. This operation will have some overhead for int/long/boolean >> types. We can separate the calculation of the coder from the calculation of >> the len

Re: RFR: 8336856: Optimize String Concat [v23]

2024-08-01 Thread Claes Redestad
On Fri, 2 Aug 2024 00:59:06 GMT, Shaojin Wen wrote: >> The current implementation of StringConcat is to mix the coder and length >> into a long. This operation will have some overhead for int/long/boolean >> types. We can separate the calculation of the coder from the calculation of >> the len

Re: RFR: 8336856: Optimize String Concat [v23]

2024-08-01 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8336856: Optimize String Concat [v22]

2024-08-01 Thread Shaojin Wen
On Wed, 31 Jul 2024 22:27:53 GMT, Shaojin Wen wrote: >> The current implementation of StringConcat is to mix the coder and length >> into a long. This operation will have some overhead for int/long/boolean >> types. We can separate the calculation of the coder from the calculation of >> the le

Re: RFR: 8336856: Optimize String Concat [v22]

2024-07-31 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8336856: Optimize String Concat [v21]

2024-07-31 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8336856: Optimize String Concat [v20]

2024-07-31 Thread Claes Redestad
On Sun, 28 Jul 2024 15:59:05 GMT, Shaojin Wen wrote: >> The current implementation of StringConcat is to mix the coder and length >> into a long. This operation will have some overhead for int/long/boolean >> types. We can separate the calculation of the coder from the calculation of >> the le

Re: RFR: 8336856: Optimize String Concat [v20]

2024-07-28 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8336856: Optimize String Concat [v19]

2024-07-28 Thread Claes Redestad
On Sun, 28 Jul 2024 13:58:05 GMT, Shaojin Wen wrote: >> The current implementation of StringConcat is to mix the coder and length >> into a long. This operation will have some overhead for int/long/boolean >> types. We can separate the calculation of the coder from the calculation of >> the le

Re: RFR: 8336856: Optimize String Concat [v19]

2024-07-28 Thread Shaojin Wen
On Sun, 28 Jul 2024 13:58:05 GMT, Shaojin Wen wrote: >> The current implementation of StringConcat is to mix the coder and length >> into a long. This operation will have some overhead for int/long/boolean >> types. We can separate the calculation of the coder from the calculation of >> the le

Re: RFR: 8336856: Optimize String Concat [v19]

2024-07-28 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8336856: Optimize String Concat [v15]

2024-07-28 Thread Claes Redestad
On Thu, 25 Jul 2024 23:36:02 GMT, Shaojin Wen wrote: >> test/micro/org/openjdk/bench/java/lang/StringConcatGenerate.java line 47: >> >>> 45: @Measurement(iterations = 5, time = 1000, timeUnit = >>> TimeUnit.MILLISECONDS) >>> 46: @Fork(value = 3, jvmArgsAppend = >>> "-Djava.lang.invoke.StringCo

Re: RFR: 8336856: Optimize String Concat [v18]

2024-07-28 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8336856: Optimize String Concat [v16]

2024-07-28 Thread Claes Redestad
On Sat, 27 Jul 2024 23:08:36 GMT, Shaojin Wen wrote: > Should mixer and prepend add the two types of Integer and Long? Now we need > to do integer.toString and then concatenate, which leads to performance > degradation. I think the generic problem with specializing on types is that this leads

Re: RFR: 8336856: Optimize String Concat [v17]

2024-07-28 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8336856: Optimize String Concat [v16]

2024-07-28 Thread Shaojin Wen
On Thu, 25 Jul 2024 14:52:11 GMT, Shaojin Wen wrote: >> The current implementation of StringConcat is to mix the coder and length >> into a long. This operation will have some overhead for int/long/boolean >> types. We can separate the calculation of the coder from the calculation of >> the le

Re: RFR: 8336856: Optimize String Concat [v15]

2024-07-25 Thread Shaojin Wen
On Thu, 25 Jul 2024 10:15:20 GMT, Claes Redestad wrote: >> Shaojin Wen has updated the pull request incrementally with one additional >> commit since the last revision: >> >> add benchmark > > test/micro/org/openjdk/bench/java/lang/StringConcatGenerate.java line 47: > >> 45: @Measurement(ite

Re: RFR: 8336856: Optimize String Concat [v16]

2024-07-25 Thread Shaojin Wen
On Thu, 25 Jul 2024 14:52:11 GMT, Shaojin Wen wrote: >> The current implementation of StringConcat is to mix the coder and length >> into a long. This operation will have some overhead for int/long/boolean >> types. We can separate the calculation of the coder from the calculation of >> the le

Re: RFR: 8336856: Optimize String Concat [v16]

2024-07-25 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8336856: Optimize String Concat [v15]

2024-07-25 Thread Claes Redestad
On Thu, 25 Jul 2024 08:58:14 GMT, Shaojin Wen wrote: >> The current implementation of StringConcat is to mix the coder and length >> into a long. This operation will have some overhead for int/long/boolean >> types. We can separate the calculation of the coder from the calculation of >> the le

Re: RFR: 8336856: Optimize String Concat [v15]

2024-07-25 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8336856: Optimize String Concat [v14]

2024-07-25 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8336856: Optimize String Concat [v11]

2024-07-24 Thread Shaojin Wen
On Wed, 24 Jul 2024 15:08:50 GMT, Chen Liang wrote: >> If you do not use TRUSTED Lookup, errors will occur when processing records. >> >> You can see this build error >> https://github.com/wenshao/jdk/actions/runs/10049344961/job/27775952878 >> >> TEST: java/lang/reflect/records/RecordReflecti

Re: RFR: 8336856: Optimize String Concat [v5]

2024-07-24 Thread Shaojin Wen
On Tue, 23 Jul 2024 13:35:41 GMT, Claes Redestad 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 six commits: >> >> - Merge remote-tracking branch 'origin/optim_simple_concat_202407' into >> optim_concat_fa

Re: RFR: 8336856: Optimize String Concat [v11]

2024-07-24 Thread Chen Liang
On Wed, 24 Jul 2024 14:56:48 GMT, Shaojin Wen wrote: >> src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java line >> 1119: >> >>> 1117: >>> 1118: private static MethodHandle generate(Lookup lookup, >>> MethodType args, String[] constants) throws Exception { >>> 1119:

Re: RFR: 8336856: Optimize String Concat [v11]

2024-07-24 Thread Shaojin Wen
On Wed, 24 Jul 2024 14:34:01 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 32 commits: >> >> - Merge remote-tracking branch 'upstream/master' into >> optim_concat_factory_202407 >> - typo

Re: RFR: 8336856: Optimize String Concat [v13]

2024-07-24 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8336856: Optimize String Concat [v12]

2024-07-24 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8336856: Optimize String Concat [v11]

2024-07-24 Thread Chen Liang
On Wed, 24 Jul 2024 11:43:45 GMT, Shaojin Wen wrote: >> The current implementation of StringConcat is to mix the coder and length >> into a long. This operation will have some overhead for int/long/boolean >> types. We can separate the calculation of the coder from the calculation of >> the le

Re: RFR: 8336856: Optimize String Concat [v11]

2024-07-24 Thread Shaojin Wen
On Wed, 24 Jul 2024 11:43:45 GMT, Shaojin Wen wrote: >> The current implementation of StringConcat is to mix the coder and length >> into a long. This operation will have some overhead for int/long/boolean >> types. We can separate the calculation of the coder from the calculation of >> the le

Re: RFR: 8336856: Optimize String Concat [v11]

2024-07-24 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8336856: Optimize String Concat [v10]

2024-07-24 Thread Claes Redestad
On Wed, 24 Jul 2024 10:18:03 GMT, Shaojin Wen wrote: >> The current implementation of StringConcat is to mix the coder and length >> into a long. This operation will have some overhead for int/long/boolean >> types. We can separate the calculation of the coder from the calculation of >> the le

Re: RFR: 8336856: Optimize String Concat [v10]

2024-07-24 Thread Shaojin Wen
On Wed, 24 Jul 2024 10:18:03 GMT, Shaojin Wen wrote: >> The current implementation of StringConcat is to mix the coder and length >> into a long. This operation will have some overhead for int/long/boolean >> types. We can separate the calculation of the coder from the calculation of >> the le

Re: RFR: 8336856: Optimize String Concat [v10]

2024-07-24 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8336856: Optimize String Concat [v9]

2024-07-23 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8336856: Optimize String Concat [v8]

2024-07-23 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8336856: Optimize String Concat [v7]

2024-07-23 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8336856: Optimize String Concat [v6]

2024-07-23 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8336856: Optimize String Concat

2024-07-23 Thread Chen Liang
On Tue, 23 Jul 2024 09:02:48 GMT, Shaojin Wen wrote: > The ClassData of LambdaMetafactory has only one MethodHandle, but multiple > MethodHandles are needed here. In these cases, we pass a `List.of(methodHandles)`, and call extra `.constantInstruction(index).invokeinterface(CD_List, "get", MTD

Re: RFR: 8336856: Optimize String Concat [v5]

2024-07-23 Thread Claes Redestad
On Tue, 23 Jul 2024 12:22:57 GMT, Shaojin Wen wrote: >> The current implementation of StringConcat is to mix the coder and length >> into a long. This operation will have some overhead for int/long/boolean >> types. We can separate the calculation of the coder from the calculation of >> the le

Re: RFR: 8336856: Optimize String Concat [v5]

2024-07-23 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8336856: Optimize String Concat [v4]

2024-07-23 Thread Shaojin Wen
On Tue, 23 Jul 2024 10:19:47 GMT, Shaojin Wen wrote: >> The current implementation of StringConcat is to mix the coder and length >> into a long. This operation will have some overhead for int/long/boolean >> types. We can separate the calculation of the coder from the calculation of >> the le

Re: RFR: 8336856: Optimize String Concat [v4]

2024-07-23 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8336856: Optimize String Concat

2024-07-23 Thread Shaojin Wen
On Mon, 22 Jul 2024 14:27:39 GMT, Chen Liang wrote: > For the question > [here](https://github.com/openjdk/jdk/pull/20253#issuecomment-2242267516): > > 1. A sample of loading an otherwise inaccessible method handle from class > data: > https://github.com/openjdk/jdk/blob/c3226aaeb810521257e96

Re: RFR: 8336856: Optimize String Concat [v3]

2024-07-22 Thread Shaojin Wen
On Mon, 22 Jul 2024 22:34:01 GMT, Shaojin Wen wrote: >> The current implementation of StringConcat is to mix the coder and length >> into a long. This operation will have some overhead for int/long/boolean >> types. We can separate the calculation of the coder from the calculation of >> the le

Re: RFR: 8336856: Optimize String Concat [v3]

2024-07-22 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8336856: Optimize String Concat [v2]

2024-07-22 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8336856: Optimize String Concat

2024-07-22 Thread Chen Liang
On Sun, 21 Jul 2024 12:25:36 GMT, Shaojin Wen wrote: > The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length

Re: RFR: 8336856: Optimize String Concat

2024-07-21 Thread Claes Redestad
On Sun, 21 Jul 2024 12:25:36 GMT, Shaojin Wen wrote: > The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length

Re: RFR: 8336856: Optimize String Concat

2024-07-21 Thread Shaojin Wen
On Sun, 21 Jul 2024 12:25:36 GMT, Shaojin Wen wrote: > The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length

RFR: 8336856: Optimize String Concat

2024-07-21 Thread Shaojin Wen
The current implementation of StringConcat is to mix the coder and length into a long. This operation will have some overhead for int/long/boolean types. We can separate the calculation of the coder from the calculation of the length, which can improve the performance in the scenario of concat i