RFR: 8362193: Re-work MacOS/AArch64 SpinPause to handle SB [v3]

Fredrik Bredberg fbredberg at openjdk.org
Wed Jul 23 10:10:55 UTC 2025


On Tue, 22 Jul 2025 22:41:32 GMT, Evgeny Astigeevich <eastigeevich at openjdk.org> wrote:

>> For the default YIELD we have:
>> - Original: ~250 clocks
>> - Compiler binary search tree: ~200 clocks (-20%)
>> - Optimized with `TBZ`: ~150 clocks (-40%)
>
> I think the differences might be smaller on the real hardware. Maybe everything will be around 200 clocks.
> If we need code easy to maintain then this is `switch`. If we need performance then this is `tbz`.

@eastig 
When I tested [JDK-8320317](https://bugs.openjdk.org/browse/JDK-8320317) the DaCapo-h2-large test showed very stable values when run multiple times. The performance went up on Linux x86 and Windows x86 by approximately 12%, but went down with roughly the same amount on macOS AArch64. That performance decreased could however be avoided by implement `SpinPause()` on macOS. So I fixed that in [JDK-8321371](https://bugs.openjdk.org/browse/JDK-8321371).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26387#discussion_r2225054012


More information about the hotspot-dev mailing list