On Thu, 5 Jan 2023 12:18:58 GMT, Per Minborg <pminb...@openjdk.org> wrote:
>> Currently, `java.io.Bits` is using explicit logic to read/write various >> primitive types to/from byte arrays. Switching to the use of `VarHandle` >> access would provide better performance and less code. >> >> Also, using a standard API for these conversions means future `VarHandle` >> improvements will benefit `Bits` too. >> >> Improvements in `Bits` will propagate to `ObjectInputStream`, >> `ObjectOutputStream` and `RandomAccessFile`. >> >> Initial benchmarks and performance discussions can be found here: >> https://github.com/openjdk/panama-foreign/pull/762 > > Per Minborg has updated the pull request incrementally with one additional > commit since the last revision: > > Use canonical NaN values also for read src/java.base/share/classes/java/io/Bits.java line 65: > 63: > 64: static float getFloat(byte[] b, int off) { > 65: // Using Float.floatToIntBits collapses NaN values to a single comment is referring to wrong method src/java.base/share/classes/java/io/Bits.java line 75: > 73: > 74: static double getDouble(byte[] b, int off) { > 75: // Using Double.doubleToLongBits collapses NaN values to a single same here ------------- PR: https://git.openjdk.org/jdk/pull/11840