On Tue, 15 Sep 2026 16:26:12 GMT, Alan Bateman <[email protected]> wrote:
>> 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 ... > > Do we have enough micros in test/micro for Exchanger? @AlanBateman I've put together a JMH bench for the exchange-method (which is the bench that generated the numbers in the PR description), I could clean that bench up a bit and attach it to this PR so that there's something to guide any tuning of the SPINS-constant in the future. ------------- PR Comment: https://git.openjdk.org/jdk/pull/32886#issuecomment-5684046756
