On Mon, 12 Aug 2024 14:47:13 GMT, Claes Redestad <[email protected]> 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: @ForceInline
>> 83: private final String concat(char value) {
>
> These mostly help avoid a bit of class spinning on startup, right? I think
> it's fine to add these now, but we should perhaps consider ways to
> pre-generate concat shapes more deliberately (e.g. using
> `GenerateJLIClassesHelper/-Plugin` to pre-spin concat classes when jlinking
> an image) rather than manually stamping out code here. If small arity concats
> benefit in throughput tests from a subtly different code shape then that
> should be reflected in the code generator.
The current implementation generates length and coder methods, which slows down
the startup. The built-in concat1 is to improve the startup speed. 1 parameter
is a very common scenario. The current implementation does not need to add more
classes. It is a lightweight implementation, so I keep it. In addition, I also
need to learn how GenerateJLIClassesHelper works.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20273#discussion_r1714106975