RFR: 8276054: JMH benchmarks for Fences [v3]
Claes Redestad
redestad at openjdk.java.net
Thu Oct 28 17:50:20 UTC 2021
On Thu, 28 Oct 2021 07:50:55 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> While working on JDK-8252990, I realized there are no microbenchmarks for Fences. I would be good to add some. While technically we can benchmark `Unsafe` directly, I instead chose to use the public API, `VarHandles`, as this captures the real-world uses too.
>>
>> Sample output for `make test TEST=micro:vm.fences` on `x86_64`:
>>
>>
>> Benchmark Mode Cnt Score Error Units
>> Multiple.acquire avgt 9 0.408 ± 0.005 ns/op
>> Multiple.full avgt 9 4.694 ± 0.003 ns/op
>> Multiple.plain avgt 9 0.407 ± 0.004 ns/op
>> Multiple.release avgt 9 0.407 ± 0.003 ns/op
>> Multiple.storeStore avgt 9 0.409 ± 0.006 ns/op
>> MultipleWithLoads.acquire avgt 9 4.600 ± 0.002 ns/op
>> MultipleWithLoads.full avgt 9 8.322 ± 0.003 ns/op
>> MultipleWithLoads.plain avgt 9 4.328 ± 0.001 ns/op
>> MultipleWithLoads.release avgt 9 4.600 ± 0.002 ns/op
>> MultipleWithLoads.storeStore avgt 9 4.600 ± 0.002 ns/op
>> MultipleWithStores.acquire avgt 9 0.812 ± 0.001 ns/op
>> MultipleWithStores.full avgt 9 5.291 ± 0.001 ns/op
>> MultipleWithStores.plain avgt 9 0.812 ± 0.001 ns/op
>> MultipleWithStores.release avgt 9 0.812 ± 0.001 ns/op
>> MultipleWithStores.storeStore avgt 9 0.812 ± 0.001 ns/op
>> SafePublishing.plain avgt 9 6.378 ± 0.011 ns/op
>> SafePublishing.release avgt 9 6.368 ± 0.010 ns/op
>> SafePublishing.storeStore avgt 9 6.376 ± 0.013 ns/op
>> Single.acquireFence avgt 9 0.410 ± 0.009 ns/op
>> Single.fullFence avgt 9 4.689 ± 0.002 ns/op
>> Single.plain avgt 9 0.409 ± 0.010 ns/op
>> Single.releaseFence avgt 9 0.410 ± 0.006 ns/op
>> Single.storeStoreFence avgt 9 0.410 ± 0.009 ns/op
>
> Aleksey Shipilev has updated the pull request incrementally with two additional commits since the last revision:
>
> - Consistent benchmark names: drop excess "Fence"
> - Add loadLoad tests too
I think the general rule in OpenJDK projects is simply one reviewer approval. I have not seen a need to try and add any special rules. I'm also not even sure where special rules - like those enforced by the hotspot maintainers (two reviewers, 24hr grace time) - are written down.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6138
More information about the hotspot-dev
mailing list