[riscv-port-jdk17u:riscv-port] RFR: 8296602: RISC-V: improve performance of copy_memory stub

Vladimir Kempik vkempik at openjdk.org
Mon Mar 13 07:28:46 UTC 2023


On Sat, 11 Mar 2023 02:26:46 GMT, Fei Yang <fyang at openjdk.org> wrote:

>> Please review this backport of JDK-8296602 to jdk17u
>> This effectively unrolls copy memory loop offering significant perf improvement on real hw platforms. ( data are the same as in original commit) 
>> 
>> RISC-V only change, low risk for other platforms.
>> Testing: TBD.
>> 
>> thead rvb-ice c910
>> thead
>> 
>> 
>> Before ( copy8 only )
>> Benchmark (size) Mode Cnt Score Error Units
>> ArrayCopyObject.conjoint_micro 31 thrpt 25 6653.095 ± 251.565 ops/ms
>> ArrayCopyObject.conjoint_micro 63 thrpt 25 4933.970 ± 77.559 ops/ms
>> ArrayCopyObject.conjoint_micro 127 thrpt 25 3627.454 ± 34.589 ops/ms
>> ArrayCopyObject.conjoint_micro 2047 thrpt 25 368.249 ± 0.453 ops/ms
>> ArrayCopyObject.conjoint_micro 4095 thrpt 25 187.776 ± 0.306 ops/ms
>> ArrayCopyObject.conjoint_micro 8191 thrpt 25 94.477 ± 0.340 ops/ms
>> 
>> after ( with copy32 )
>> ArrayCopyObject.conjoint_micro 31 thrpt 25 7620.546 ± 69.756 ops/ms
>> ArrayCopyObject.conjoint_micro 63 thrpt 25 6677.978 ± 33.112 ops/ms
>> ArrayCopyObject.conjoint_micro 127 thrpt 25 5206.973 ± 22.612 ops/ms
>> ArrayCopyObject.conjoint_micro 2047 thrpt 25 653.655 ± 31.494 ops/ms
>> ArrayCopyObject.conjoint_micro 4095 thrpt 25 352.905 ± 7.390 ops/ms
>> ArrayCopyObject.conjoint_micro 8191 thrpt 25 165.127 ± 0.832 ops/ms
>> 
>> after ( copy32 with dead code elimination and independent addis )
>> ArrayCopyObject.conjoint_micro 31 thrpt 25 7576.346 ? 94.487 ops/ms
>> ArrayCopyObject.conjoint_micro 63 thrpt 25 6475.730 ? 252.590 ops/ms
>> ArrayCopyObject.conjoint_micro 127 thrpt 25 5221.764 ? 20.415 ops/ms
>> ArrayCopyObject.conjoint_micro 2047 thrpt 25 691.847 ? 1.102 ops/ms
>> ArrayCopyObject.conjoint_micro 4095 thrpt 25 360.269 ? 1.091 ops/ms
>> ArrayCopyObject.conjoint_micro 8191 thrpt 25 179.733 ? 3.012 ops/ms
>> 
>> on hifive unmatched:
>> 
>> before:
>> Benchmark (size) Mode Cnt Score Error Units
>> ArrayCopyObject.conjoint_micro 31 thrpt 25 5391.575 ± 152.984 ops/ms
>> ArrayCopyObject.conjoint_micro 63 thrpt 25 3700.946 ± 43.175 ops/ms
>> ArrayCopyObject.conjoint_micro 127 thrpt 25 2316.160 ± 24.734 ops/ms
>> ArrayCopyObject.conjoint_micro 2047 thrpt 25 188.616 ± 0.151 ops/ms
>> ArrayCopyObject.conjoint_micro 4095 thrpt 25 95.323 ± 0.053 ops/ms
>> ArrayCopyObject.conjoint_micro 8191 thrpt 25 46.935 ± 0.041 ops/ms
>> 
>> after:
>> Benchmark (size) Mode Cnt Score Error Units
>> ArrayCopyObject.conjoint_micro 31 thrpt 25 6136.169 ± 330.409 ops/ms
>> ArrayCopyObject.conjoint_micro 63 thrpt 25 4924.020 ± 78.529 ops/ms
>> ArrayCopyObject.conjoint_micro 127 thrpt 25 3732.561 ± 89.606 ops/ms
>> ArrayCopyObject.conjoint_micro 2047 thrpt 25 431.103 ± 0.505 ops/ms
>> ArrayCopyObject.conjoint_micro 4095 thrpt 25 221.543 ± 0.363 ops/ms
>> ArrayCopyObject.conjoint_micro 8191 thrpt 25 100.586 ± 0.197 ops/ms
>
> Thanks for filing the upstream backporting to fix the failing tests. I will do a merge once that's integrated. 
> Regarding this performance backporting, I would put off integration for a while after several other nasty bugs are fixed.

@RealFYang , it's integrated

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

PR: https://git.openjdk.org/riscv-port-jdk17u/pull/9


More information about the riscv-port-dev mailing list