RFR: 8352316: More MergeStoreBench
Emanuel Peter
epeter at openjdk.org
Tue Mar 25 16:57:08 UTC 2025
On Wed, 19 Mar 2025 06:02:17 GMT, Shaojin Wen <swen at openjdk.org> wrote:
>> Added performance tests related to String.getBytes/String.getChars/StringBuilder.append/System.arraycopy in constant scenarios to verify whether MergeStore works
>
> The performance numbers show that putNull_unsafePutInt and putNull_utf16_unsafePutLong perform more than 10 times better. It can be seen that MergeStore is very suitable for these scenarios.
>
> # Scipt
>
> git remote add wenshao git at github.com:wenshao/jdk.git
> git fetch wenshao
> git clone 23dba8c52454ae90eab4cb1b0a168c6e7249dd38
> make test TEST="micro:vm.compiler.MergeStoreBench.putNull"
>
>
> ## 2. aliyun_ecs_c8a_x64 (CPU AMD EPYC™ Genoa)
>
> Benchmark Mode Cnt Score Error Units
> MergeStoreBench.putNull_arraycopy avgt 5 6715.041 ± 18.765 ns/op
> MergeStoreBench.putNull_getBytes avgt 5 5880.725 ± 12.261 ns/op
> MergeStoreBench.putNull_getChars avgt 5 11972.642 ± 24.990 ns/op
> MergeStoreBench.putNull_string_builder avgt 5 15643.372 ± 4526.932 ns/op
> MergeStoreBench.putNull_unsafePutInt avgt 5 280.570 ± 0.669 ns/op
> MergeStoreBench.putNull_utf16_arrayCopy avgt 5 13053.191 ± 24.954 ns/op
> MergeStoreBench.putNull_utf16_string_builder avgt 5 16349.747 ± 5029.799 ns/op
> MergeStoreBench.putNull_utf16_unsafePutLong avgt 5 579.580 ± 0.710 ns/op
>
>
>
> ## 3. aliyun_ecs_c8i_x64 (CPU Intel®Xeon®Emerald Rapids)
>
> Benchmark Mode Cnt Score Error Units
> MergeStoreBench.putNull_arraycopy avgt 5 8029.622 ± 60.856 ns/op
> MergeStoreBench.putNull_getBytes avgt 5 7444.635 ± 39.552 ns/op
> MergeStoreBench.putNull_getChars avgt 5 16657.442 ± 147.301 ns/op
> MergeStoreBench.putNull_string_builder avgt 5 23008.159 ± 6143.167 ns/op
> MergeStoreBench.putNull_unsafePutInt avgt 5 235.302 ± 2.004 ns/op
> MergeStoreBench.putNull_utf16_arrayCopy avgt 5 18330.317 ± 142.242 ns/op
> MergeStoreBench.putNull_utf16_string_builder avgt 5 25843.593 ± 7089.392 ns/op
> MergeStoreBench.putNull_utf16_unsafePutLong avgt 5 1860.076 ± 16.703 ns/op
>
>
> ## 4. aliyun_ecs_c8y_aarch64 (CPU Aliyun Yitian 710)
>
> Benchmark Mode Cnt Score Error Units
> MergeStoreBench.putNull_arraycopy avgt 5 8114.176 ± 36.685 ns/op
> MergeStoreBench.putNull_getBytes avgt 5 6171.538 ± 5.845 ns/op
> MergeStoreBench.putNull_getChars avgt 5 10432.681 ± 26.401 ns/op
> MergeStoreBench.putNull_string_builder avgt 5 21238.753 ± 1428.244 n...
@wenshao Do you have any insight from this benchmark? What was your motivation for it?
I also wonder if an IR test for some of the cases would be helpful. IR tests give us more info about what the compiler produced, and if there is a change in VM behaviour the IR test catches it in regular testing. Benchmarks are not run regularly, and regressions would therefore not be caught.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24108#issuecomment-2751928466
More information about the hotspot-compiler-dev
mailing list