On Wed, 1 Feb 2023 15:13:27 GMT, Per Minborg <pminb...@openjdk.org> wrote:

>> This PR suggests improving performance by using the newly introduced class 
>> `jdk.internal.util.ByteArray` to improve packing/unpacking operations.
>> 
>> The PR also proposes adding a `ByteArrayLittleEndian` class for support for 
>> little endian packing/unpacking.
>
> Per Minborg has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Add benchmark

Here are some benchmarks:


Baseline (JDK21, master (called Java 20 below))
Benchmark                       Mode  Cnt  Score   Error  Units
ImageInputStreamBench.readInt   avgt   15  1.289 ± 0.029  ns/op
ImageInputStreamBench.readLong  avgt   15  1.308 ± 0.017  ns/op

Patch (called Java 21 below)
Benchmark                       Mode  Cnt  Score   Error  Units
ImageInputStreamBench.readInt   avgt   15  0.946 ± 0.046  ns/op
ImageInputStreamBench.readLong  avgt   15  0.954 ± 0.010  ns/op



![image](https://user-images.githubusercontent.com/7457876/216359253-a2594137-0c7f-4fac-a673-177576fc43ed.png)

-------------

PR: https://git.openjdk.org/jdk/pull/12204

Reply via email to