RFR: 8359218: RISC-V: Only enable CRC32 intrinsic when AvoidUnalignedAccess == false

Fei Yang fyang at openjdk.org
Wed Jun 11 10:49:30 UTC 2025


On Wed, 11 Jun 2025 08:47:49 GMT, Anjian Wen <wenanjian at openjdk.org> wrote:

> When test **Specjvm** in p550, we can find the compress test result shown below.
> 
> 
> before patch
> -XX:-UseCompactObjectHeaders
> Warmup (30s) begins: Wed Jun 11 16:10:18 CST 2025
> Warmup (30s) ends:   Wed Jun 11 16:10:53 CST 2025
> Warmup (30s) result: 68.98 ops/m
> 
> Iteration 1 (60s) begins: Wed Jun 11 16:10:53 CST 2025
> Iteration 1 (60s) ends:   Wed Jun 11 16:11:57 CST 2025
> Iteration 1 (60s) result: 71.25 ops/m
> 
> 
> -XX:+UseCompactObjectHeaders
> Warmup (30s) begins: Wed Jun 11 16:13:03 CST 2025
> Warmup (30s) ends:   Wed Jun 11 16:13:42 CST 2025
> Warmup (30s) result: 31.87 ops/m
> 
> Iteration 1 (60s) begins: Wed Jun 11 16:13:42 CST 2025
> Iteration 1 (60s) ends:   Wed Jun 11 16:14:56 CST 2025
> Iteration 1 (60s) result: 29.13 ops/m
> 
> 
> The reason is that when enable compactObjectHeaders, the arraylist header turn to 4 Byte, but the copy instruction used in CRC intrinsic loop is 8 Byte one loop, which may reduce the performance when hardware is sensitive to unaligned access, we can close it when AvoidUnalignedAccesses is true
> 
> after patch 
> 
> -XX:-UseCompactObjectHeaders
> Warmup (30s) begins: Wed Jun 11 16:23:22 CST 2025
> Warmup (30s) ends:   Wed Jun 11 16:23:57 CST 2025
> Warmup (30s) result: 68.61 ops/m
> 
> Iteration 1 (60s) begins: Wed Jun 11 16:23:57 CST 2025
> Iteration 1 (60s) ends:   Wed Jun 11 16:25:00 CST 2025
> Iteration 1 (60s) result: 71.57 ops/m
> 
> 
> -XX:+UseCompactObjectHeaders
> Warmup (30s) begins: Wed Jun 11 16:25:28 CST 2025
> Warmup (30s) ends:   Wed Jun 11 16:26:03 CST 2025
> Warmup (30s) result: 68.36 ops/m
> 
> Iteration 1 (60s) begins: Wed Jun 11 16:26:03 CST 2025
> Iteration 1 (60s) ends:   Wed Jun 11 16:27:08 CST 2025
> Iteration 1 (60s) result: 70.85 ops/m

Thanks for finding this!

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

Marked as reviewed by fyang (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/25743#pullrequestreview-2916614388


More information about the hotspot-dev mailing list