RFR: 8339290: Optimize ClassFile Utf8EntryImpl#writeTo [v17]
Shaojin Wen
swen at openjdk.org
Wed Sep 4 11:51:56 UTC 2024
On Wed, 4 Sep 2024 10:59:33 GMT, Claes Redestad <redestad at openjdk.org> wrote:
>> Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision:
>>
>> optimize for utf16
>
> src/java.base/share/classes/jdk/internal/classfile/impl/BufWriterImpl.java line 165:
>
>> 163: int countNonZeroAscii = JLA.countNonZeroAscii(str);
>> 164: int utflen = strlen;
>> 165: if (countNonZeroAscii != strlen) {
>
> Perhaps skip the count if `strlen` is already too large (we'll throw in the next block)
> Suggestion:
>
> if (strlen <= 65535 && countNonZeroAscii != strlen) {
Let’s not add this, because normal logic should not pay the cost for abnormal logic
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20772#discussion_r1743626412
More information about the core-libs-dev
mailing list