Re: RFR: 8299576: Reimplement java.io.Bits using VarHandle access [v2]

2023-01-30 Thread Andriy Plokhotnyuk
On Mon, 30 Jan 2023 08:41:25 GMT, Per Minborg wrote: > > java.time.ZoneOffset > > Maybe I am blind but can you provide a direct reference to an exising JDK > method in `java.time` where we can apply similar optimizations? No problem! We can start from `java.time.ZoneOffset` and its `parse` and

Re: RFR: 8299576: Reimplement java.io.Bits using VarHandle access [v2]

2023-01-30 Thread Per Minborg
On Wed, 4 Jan 2023 13:16:26 GMT, Andriy Plokhotnyuk wrote: > java.time.ZoneOffset Maybe I am blind but can you provide a direct reference to an exising JDK method in `java.time` where we can apply similar optimizations? - PR: https://git.openjdk.org/jdk/pull/11840

Re: RFR: 8299576: Reimplement java.io.Bits using VarHandle access [v2]

2023-01-17 Thread Quan Anh Mai
On Tue, 17 Jan 2023 08:30:58 GMT, Sergey Tsypanov wrote: >>> > Do you see any concrete examples of classes in the JDK that could benefit >>> > from a "VarHandlization"? >>> >>> `ImageOutputStreamImpl` and `ImageInputStreamImpl` in >>> `javax.imageio.stream` have some very similar code that mig

Re: RFR: 8299576: Reimplement java.io.Bits using VarHandle access [v2]

2023-01-17 Thread Sergey Tsypanov
On Tue, 17 Jan 2023 07:43:07 GMT, Per Minborg wrote: >>> >>> Do you see any concrete examples of classes in the JDK that could benefit >>> from a "VarHandlization"? >> >> `ImageOutputStreamImpl` and `ImageInputStreamImpl` in >> `javax.imageio.stream` have some very similar code that might

Re: RFR: 8299576: Reimplement java.io.Bits using VarHandle access [v2]

2023-01-16 Thread Per Minborg
On Tue, 17 Jan 2023 01:08:09 GMT, j3graham wrote: > > Do you see any concrete examples of classes in the JDK that could benefit > > from a "VarHandlization"? > > `ImageOutputStreamImpl` and `ImageInputStreamImpl` in `javax.imageio.stream` > have some very similar code that might benefit. Also

Re: RFR: 8299576: Reimplement java.io.Bits using VarHandle access [v2]

2023-01-16 Thread j3graham
On Wed, 4 Jan 2023 13:16:26 GMT, Andriy Plokhotnyuk wrote: > > Do you see any concrete examples of classes in the JDK that could benefit > from a "VarHandlization"? `ImageOutputStreamImpl` and `ImageInputStreamImpl` in `javax.imageio.stream` have some very similar code that might benefit.

Re: RFR: 8299576: Reimplement java.io.Bits using VarHandle access [v2]

2023-01-04 Thread Andriy Plokhotnyuk
On Wed, 4 Jan 2023 12:40:43 GMT, Per Minborg wrote: > > @minborg Amazing piece! > > Will `java.lang.invoke.VarHandle` instances be shared in JDK to reuse in > > other places? > > The > > [jsoniter-scala-coreJVM](https://github.com/plokhotnyuk/jsoniter-scala/tree/master/jsoniter-scala-core/jvm/s

Re: RFR: 8299576: Reimplement java.io.Bits using VarHandle access [v2]

2023-01-04 Thread Per Minborg
On Wed, 4 Jan 2023 10:49:18 GMT, Per Minborg wrote: >> Do we need this test at all, because this code is tested to extense through >> RandomAccessFile? We had no test before, so why add a new one here? >> >> Otherwise: PR looks good. > >> Do we need this test at all, because this code is tested

Re: RFR: 8299576: Reimplement java.io.Bits using VarHandle access [v2]

2023-01-04 Thread Andriy Plokhotnyuk
On Wed, 4 Jan 2023 10:49:18 GMT, Per Minborg wrote: >> Do we need this test at all, because this code is tested to extense through >> RandomAccessFile? We had no test before, so why add a new one here? >> >> Otherwise: PR looks good. > >> Do we need this test at all, because this code is tested

Re: RFR: 8299576: Reimplement java.io.Bits using VarHandle access [v2]

2023-01-04 Thread Per Minborg
On Wed, 4 Jan 2023 09:25:40 GMT, Uwe Schindler wrote: > Do we need this test at all, because this code is tested to extense through > RandomAccessFile? We had no test before, so why add a new one here? > > Otherwise: PR looks good. There are overlaps of the RAF and Bits tests but the latter te

Re: RFR: 8299576: Reimplement java.io.Bits using VarHandle access [v2]

2023-01-04 Thread Per Minborg
On Wed, 4 Jan 2023 09:01:06 GMT, Per Minborg 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

Re: RFR: 8299576: Reimplement java.io.Bits using VarHandle access [v2]

2023-01-04 Thread Uwe Schindler
On Wed, 4 Jan 2023 09:01:06 GMT, Per Minborg 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

Re: RFR: 8299576: Reimplement java.io.Bits using VarHandle access [v2]

2023-01-04 Thread Per Minborg
> 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` > improvem