RFR: 8353741: Improve UUID.toString performance by using SIMD within a register instead of table lookup [v3]
Shaojin Wen
swen at openjdk.org
Thu Apr 10 06:00:26 UTC 2025
On Tue, 8 Apr 2025 18:04:43 GMT, Johannes Graham <duke at openjdk.org> wrote:
> Have you considered removing `reverseBytes` and using `ByteArray` instead of `ByteArrayLittleEndian`?
I tested it on a MacBook M1 Max, and the performance of using reverseBytes + ByteArrayLittleEndian is about 1% faster. Considering that most of us have little-endian machines, ByteArray.setInt/setLong also needs to do reverseBytes.
Doing reverseBytes in hex8 requires 4 Long.reverseBytes in a UUID.toString call. If using ByteArray, on a little-endian machine, a UUID.toString call requires 2 Long.reverseBytes and 4 Integer.reverseBytes.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/22928#issuecomment-2791638162
More information about the core-libs-dev
mailing list