RFR: 8339290: Optimize ClassFile Utf8EntryImpl#writeTo [v14]
Claes Redestad
redestad at openjdk.org
Tue Sep 3 12:44:20 UTC 2024
On Tue, 3 Sep 2024 12:37:05 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:
>
> Update src/java.base/share/classes/java/lang/System.java
>
> Co-authored-by: Claes Redestad <claes.redestad at oracle.com>
src/java.base/share/classes/jdk/internal/access/JavaLangAccess.java line 397:
> 395:
> 396: /**
> 397: * if string#coder() is Latin1 return the count of string#value() leading greater than zero, else return 0
Can you move this next to `countPositives`?
Suggestion:
* Count the number of leading positive, non-zero bytes in the range.
Technically this new routine is the "real" `countPositives` since, mathematically speaking, zero is neither positive nor negative. It's named like it is because I'm no mathematician, and now it might be better to rename away from that to disambiguate.. If you feel like it then please file an RFE to have `countPositives` renamed to `countNonNegatives`
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20772#discussion_r1741995406
More information about the core-libs-dev
mailing list