RFR: 8339290: Optimize ClassFile Utf8EntryImpl#writeTo [v13]

Claes Redestad redestad at openjdk.org
Tue Sep 3 12:27:25 UTC 2024


On Tue, 3 Sep 2024 11:27:53 GMT, Shaojin Wen <swen at openjdk.org> wrote:

>> Use fast path for ascii characters 1 to 127 to improve the performance of writing Utf8Entry to BufferWriter.
>
> Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   fix testcase

src/java.base/share/classes/java/lang/System.java line 2598:

> 2596: 
> 2597:             public boolean isLatin1(String s) {
> 2598:                 return s.coder() == String.LATIN1;

I recall JEP 254 authors made a point that the test for `COMPACT_STRINGS` in `String#isLatin1()` helps JIT do better dead code elimination when running with `-XX:-CompactStrings`. Also: no logic in access bridges. :)  
Suggestion:

                return s.isLatin1();

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/20772#discussion_r1741969049


More information about the core-libs-dev mailing list