RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v5]
Shaojin Wen
duke at openjdk.org
Mon Aug 26 22:32:03 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.
reuseThreshold has been changed to cacheThreshold, which is consistent with inlineThreshold, so that the performance of all scenarios is good when the default parameters are used.
The current value of 16 may be appropriate, because when the number of parameters reaches 16, the probability of reuse is very low. At this time, caching is an additional overhead, and it takes longer to reach peak performance.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/20675#issuecomment-2311217448
More information about the core-libs-dev
mailing list