RFR: 8334342: Add MergeStore JMH benchmarks

Shaojin Wen duke at openjdk.org
Mon Jun 17 08:10:12 UTC 2024


On Mon, 17 Jun 2024 07:44:33 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> [8318446](https://github.com/openjdk/jdk/pull/16245)  brings MergeStore. We need a JMH Benchmark to evaluate the performance of various batch operations and the effect of MergeStore.
>
> test/micro/org/openjdk/bench/java/lang/MergeStoreBench.java line 656:
> 
>> 654:         array[offset + 2] = (byte) (value >>  8);
>> 655:         array[offset + 3] = (byte) (value      );
>> 656:     }
> 
> You say that here `MergeStore` does not work. That is because the indices are increasing, but the shifts decreasing. So that does not work on little-endian machines (most architectures), but I would expect it to work on big-endian machines with https://github.com/openjdk/jdk/pull/19218.

Big endian is often used in network data transmission scenarios, and it is common to process big endian data on a little endian machine. In this case, can it be optimized to Integer.reverseBytes & putInt on a LittleEndian machine? `setIntB -> setIntRL`

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19734#discussion_r1642373495


More information about the core-libs-dev mailing list