RFR: 8339290: Optimize ClassFile Utf8EntryImpl#writeTo [v10]
Claes Redestad
redestad at openjdk.org
Tue Sep 3 08:42:24 UTC 2024
On Tue, 3 Sep 2024 00:38:40 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 two additional commits since the last revision:
>
> - code style
> - remove unsafe
Past experience with using intrinsics to replace similar counted loops shows that we can expect a 4-6x speed-up at scale, but only a very minor improvement for strings < 256 chars (branch, call and setup overheads eat up gains). See UTF-8 numbers here: https://cl4es.github.io/2021/02/23/Faster-Charset-Decoding.html - where we replace an ASCII-checking loop with an intrinsic: https://github.com/openjdk/jdk/pull/2574/files#diff-e5a7e70ec8192692004da7744aa38f222c64697194fbdc5278a1945234bb57dcR231
Since most strings in classfiles can be expected to be relatively short then a vectorized intrinsic might not be much of a win.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/20772#issuecomment-2325931262
More information about the core-libs-dev
mailing list