<i18n dev> RFR: 8335252: ForceInline j.u.Formatter.Conversion#isValid [v2]
Paul Sandoz
psandoz at openjdk.org
Thu Jun 27 16:03:12 UTC 2024
On Thu, 27 Jun 2024 14:12:36 GMT, Shaojin Wen <duke at openjdk.org> wrote:
>> Currently, the java.util.Formatter$Conversion::isValid method is implemented based on switch, which cannot be inlined because codeSize > 325. This problem can be avoided by implementing it with ImmutableBitSetPredicate.
>>
>> use `-XX:+UnlockDiagnosticVMOptions -XX:+PrintInlining` to see the master branch:
>>
>> @ 109 java.util.Formatter$Conversion::isValid (358 bytes) failed to inline: hot method too big
>>
>>
>> current version
>>
>> @ 109 java.util.Formatter$Conversion::isValid (10 bytes) inline (hot)
>> @ 4 jdk.internal.util.ImmutableBitSetPredicate$SmallImmutableBitSetPredicate::test (50 bytes) inline (hot)
>
> Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision:
>
> revert & use `@ForceInline`
Can you provide some additional context here? I think we need to be very careful about the general use @ForceInline in core libraries. While you show a modest performance benefit using a the micro benchmark, will it actually make any difference overall given formatting strings is not particular efficient?
String templates, currently removed, provided good string formatting performance, and the redesign will i think also provide good performance.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/19926#issuecomment-2195095064
More information about the i18n-dev
mailing list