On Wed, 4 Sep 2024 10:59:33 GMT, Claes Redestad <redes...@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