On Thu, 20 Jul 2023 16:39:31 GMT, Glavo <d...@openjdk.org> wrote: >> Here's with the same parameters as the one you are using: >> >> Benchmark Mode Cnt Score Error Units >> ByteArray.readByte thrpt 5 268722.378 ± 5979.787 ops/ms >> ByteArray.readByteFromBuffer thrpt 5 254333.844 ± 6975.034 ops/ms >> ByteArray.readInt thrpt 5 271849.915 ± 4746.869 ops/ms >> ByteArray.readIntFromBuffer thrpt 5 263109.760 ± 2764.372 ops/ms >> ByteArray.readLong thrpt 5 271635.129 ± 14705.673 ops/ms >> ByteArray.readLongFromBuffer thrpt 5 252633.826 ± 2950.184 ops/ms >> >> (Java 22/Ubuntu 20.04 on Ryzen 3900X here). > >> Here's with the same parameters as the one you are using: > > I don't understand why there is such a difference. I have replicated similar > results on several other devices: > > Apple M1: > > Benchmark Mode Cnt Score Error Units > ByteArray.readByte thrpt 5 1418606.665 ± 2308.711 ops/ms > ByteArray.readByteFromBuffer thrpt 5 879084.678 ± 20981.303 ops/ms > ByteArray.readInt thrpt 5 1404164.063 ± 4845.412 ops/ms > ByteArray.readIntFromBuffer thrpt 5 829768.843 ± 8730.467 ops/ms > ByteArray.readLong thrpt 5 1400713.660 ± 1924.752 ops/ms > ByteArray.readLongFromBuffer thrpt 5 825721.508 ± 4146.961 ops/ms > > > > Intel Celeron N5105: > > Benchmark Mode Cnt Score Error Units > ByteArray.readByte thrpt 5 927248.807 ± 29630.442 ops/ms > ByteArray.readByteFromBuffer thrpt 5 448374.359 ± 3210.571 ops/ms > ByteArray.readInt thrpt 5 719143.935 ± 183584.747 ops/ms > ByteArray.readIntFromBuffer thrpt 5 398578.488 ± 100.058 ops/ms > ByteArray.readLong thrpt 5 742555.147 ± 13006.710 ops/ms > ByteArray.readLongFromBuffer thrpt 5 398771.660 ± 1673.524 ops/ms > > > AMD Ryzen 7 5800X: > > Benchmark Mode Cnt Score Error Units > ByteArray.readByte thrpt 5 1784096.905 ± 47611.535 ops/ms > ByteArray.readByteFromBuffer thrpt 5 992974.747 ± 19389.011 ops/ms > ByteArray.readInt thrpt 5 1719368.129 ± 70606.284 ops/ms > ByteArray.readIntFromBuffer thrpt 5 919654.075 ± 9292.283 ops/ms > ByteArray.readLong thrpt 5 1719873.280 ± 18441.122 ops/ms > ByteArray.readLongFromBuffer thrpt 5 921992.992 ± 6439.747 ops/ms
On a newer processor/OS (Alder Lake/Ubuntu 22.04) I see a bit more difference: Benchmark Mode Cnt Score Error Units ByteArray.readByte thrpt 5 680397.046 ± 27504.022 ops/ms ByteArray.readByteFromBuffer thrpt 5 576449.569 ± 3633.135 ops/ms ByteArray.readInt thrpt 5 685419.089 ± 6740.268 ops/ms ByteArray.readIntFromBuffer thrpt 5 542887.418 ± 2863.907 ops/ms ByteArray.readLong thrpt 5 687949.037 ± 3510.613 ops/ms ByteArray.readLongFromBuffer thrpt 5 548120.950 ± 5461.145 ops/ms But still far from 2x. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/14636#discussion_r1269715099