On Wed, 20 Sep 2023 09:12:48 GMT, Claes Redestad <redes...@openjdk.org> wrote:
> This patch reverts the use of `ByteArrayLittleEndian` in `StringLatin1`. > > This use is the cause of a small (~1.5ms) startup regression in 22-b15. While > a manageable startup regression in and of itself, the use of `VarHandles` in > core utility classes brings an increased risk of bootstrap circularity > issues, for example disqualifying the use of things like `Integers.toString` > in some places. > > Reverting this partially rolls back the performance improvement gained by > JDK-8310929. It seems reasonable that the compiler can be enhanced to gain > that loss back. I'd like us to take a step back and instead of reaching for and sprinkling `Unsafe`, `ByteArrayLittleEndian` and `VarHandles` all over the place to instead consider differences in performance on trivial code like this as compiler bugs. We need to investigate if there's anything we can do to have the JIT generate better code here for idiomatic java, and only once we thoroughly understand if and why that's not possible to reach for other options. ------------- PR Comment: https://git.openjdk.org/jdk/pull/15836#issuecomment-1730469964