RFR: 8378698: Optimize Base64.Encoder#encodeToString
Patrick Strawderman
duke at openjdk.org
Wed Feb 25 20:11:01 UTC 2026
On Wed, 25 Feb 2026 15:58:22 GMT, Chen Liang <liach at openjdk.org> wrote:
> Hmm, I checked the code of that deprecated constructor. If the compiler can recognize `count == ascii.length` then it should be able to fold this code; maybe the compiler is too stupid. Have you verified the performance results in a benchmark?
I did not run benchmarks, just saw that the constructor copies the array (obviously since it's public), and that we use JLA in other places to avoid the copy.
> Turns out this is necessary per https://bugs.openjdk.org/browse/JDK-8364418
Yep I saw that as well, which is why I thought this would be beneficial.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/29920#issuecomment-3961737142
More information about the core-libs-dev
mailing list