RFR: 8310843: Reimplement ByteArray and ByteArrayLittleEndian with Unsafe [v10]

Glavo duke at openjdk.org
Thu Jul 20 16:14:42 UTC 2023


On Thu, 20 Jul 2023 16:01:27 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> I don't see 2x slowdown. Which JDK are you using? Which platform?

I tried running the benchmarks with OpenJDK 20.0.1 and my own jdk built from master and the results were similar. The test platform is based on Ubuntu 23.04, and the CPU is AMD Ryzen 7 3700X.

Here's the benchmark configuration I use:


@Warmup(iterations = 5, time = 3)
@Measurement(iterations = 5, time = 2)
@Fork(value = 1, jvmArgsAppend = {"-XX:+UseG1GC", "-Xms4g", "-Xmx4g"})
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)


Also, I just ran the benchmarks on my ARM machine (Ubuntu 22.04, RK3588) and here are the results:


Benchmark                      Mode  Cnt       Score       Error   Units
ByteArray.readByte            thrpt    5  637843.606 ± 23657.623  ops/ms
ByteArray.readByteFromBuffer  thrpt    5  350328.152 ±  3635.769  ops/ms
ByteArray.readInt             thrpt    5  633518.784 ±  2558.021  ops/ms
ByteArray.readIntFromBuffer   thrpt    5  327456.830 ±  4588.002  ops/ms
ByteArray.readLong            thrpt    5  627409.162 ± 29301.498  ops/ms
ByteArray.readLongFromBuffer  thrpt    5  328154.906 ±  1067.439  ops/ms

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14636#discussion_r1269686978


More information about the core-libs-dev mailing list