> I've experimented with many different approaches to approximate the number of > spins, both statically and dynamically, and going with ((1 << 13) | (1 << > 14)) or, in other words 24576, seems to have the best trade-off known by the > author at this time. > > Including benchmark results for exchanges below. > > > As compared to jdk21: > > Base > Test > Name Run target (exchanges) (virtual) Score Error > Score Error Change Unit > exchange Linux aarch64 1000 false 335791.046 ± 101.849 > 332159.281 ± 207.779 1.01x ns/op > p0.00 321536.000 > 300032.000 1.02x ns/op > p0.50 335360.000 > 343552.000 1.01x ns/op > p0.90 336384.000 > 344064.000 1.01x ns/op > p0.95 337920.000 > 345600.000 1.00x ns/op > p0.99 356352.000 > 348160.000 1.04x? ns/op > p0.999 413184.000 > 402944.000 1.05x? ns/op > p0.9999 700636.160 > 706471.629 1.01x ns/op > p1.00 1060864.000 > 1030144.000 1.01x ns/op > exchange Linux x64 1000 false 184007.923 ± 151.093 > 177661.486 ± 37.691 1.04x? ns/op > p0.00 54976.000 > 160768.000 0.93x ns/op > p0.50 187392.000 > 178432.000 1.04x? ns/op > p0.90 196352.000 > 182272.000 1.06x? ns/op > p0.95 196608.000 > 183296.000 1.05x? ns/op > p0.99 198912.000 > 185344.000 1.05x? ns/op > p0.999 202240.000 > 190208.000 1.06x? ns/op > p0.9999 226521.651 > 210782.899 1.15x ns/op > p1.00 785408.000 > 483328.000 ...
Viktor Klang has updated the pull request incrementally with one additional commit since the last revision: Adding the Exchangers.java micro-benchmark ------------- Changes: - all: https://git.openjdk.org/jdk/pull/32886/files - new: https://git.openjdk.org/jdk/pull/32886/files/a3ddff8d..8435cb3d Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=32886&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=32886&range=00-01 Stats: 116 lines in 1 file changed: 116 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/32886.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/32886/head:pull/32886 PR: https://git.openjdk.org/jdk/pull/32886
