RFR: 8343629: More MergeStore benchmark [v5]

Emanuel Peter epeter at openjdk.org
Thu Dec 5 07:07:41 UTC 2024


On Fri, 15 Nov 2024 04:15:36 GMT, Shaojin Wen <swen at openjdk.org> wrote:

>> 1. Added the putBytes4 benchmark, which corresponds to StringBuilder appendNull
>> 2. Optimized the putChars4/setInt/setLong series of benchmarks to reduce extra overhead and more accurately reflect performance differences.
>
> Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   seperate MergeStoreBench and MergeLoadBench

Hi @wenshao ! I'm sorry I lost track of this one.

It looks quite reasonable, though I was wondering why in one benchmark you increment `i` and use `i * 4` as offset, and in the other you decrement `i` and use `off += 4` as offset.

test/micro/org/openjdk/bench/vm/compiler/MergeStoreBench.java line 103:

> 101:     public void setIntBU(Blackhole BH) {
> 102:         int off = 0;
> 103:         for (int i = ints.length - 1; i >= 0; i--) {

Why are you going reverse here, and also other places? Does that affect the performance at all?

test/micro/org/openjdk/bench/vm/compiler/MergeStoreBench.java line 135:

> 133:         for (int i = ints.length - 1; i >= 0; i--) {
> 134:             setIntLU(bytes4, off, ints[i]);
> 135:             off += 4;

I'm also wondering why you changed it from multiplication of `i * 4` to `offset += 4`. Did that have an impact?

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

PR Review: https://git.openjdk.org/jdk/pull/21659#pullrequestreview-2480654227
PR Review Comment: https://git.openjdk.org/jdk/pull/21659#discussion_r1870751224
PR Review Comment: https://git.openjdk.org/jdk/pull/21659#discussion_r1870753681


More information about the hotspot-compiler-dev mailing list