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

Shaojin Wen duke at openjdk.org
Tue Aug 27 01:05:07 UTC 2024


On Mon, 26 Aug 2024 22:25:49 GMT, Shaojin Wen <duke at openjdk.org> 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 write the length and coder directly into the bytecode to solve the performance regression problem.
>
> Shaojin Wen has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - reuseThreshold -> cacheThreshold
>  - Revert "optimize for CompactStrings is off"
>    
>    This reverts commit a9fa264afd9fa625ef29357a7ca8559ce9c5fea4.

Another point is that when the parameters are large, using hard coding eliminates the need for forceinline. Without forceinline, C2 has more optimization strategy options.

All these advantages are not very strong, but adding hard-coded constants is also simple.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/20675#issuecomment-2311372610


More information about the core-libs-dev mailing list