RFR: 8333893: Optimization for StringBuilder append boolean & null [v4]
Emanuel Peter
epeter at openjdk.org
Wed Jun 12 13:27:16 UTC 2024
On Tue, 11 Jun 2024 11:35:28 GMT, Shaojin Wen <duke at openjdk.org> wrote:
>> After PR https://github.com/openjdk/jdk/pull/16245, C2 optimizes stores into primitive arrays by combining values into larger stores.
>>
>> This PR rewrites the code of appendNull and append(boolean) methods so that these two methods can be optimized by C2.
>
> Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision:
>
> revert
Fair enough. The code does say it "trusts the caller", which means the intrinsic does not do bounds check, and that may be quite the performance boost. @TobiHartmann also just pointed to this in a private conversation.
So it could be that we cannot just obsolete the `_putCharStringU`, because it gets used in all sorts of places that require it for performance.
But maybe we can avoid using it in your case. Or maybe we can change the intrinsic in such a way that it produces `StoreC` nodes which the `MergeStores` can actually combine with other `StoreC`.
What do you think @cl4es ?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/19626#issuecomment-2163005257
More information about the hotspot-compiler-dev
mailing list