Skip to content

Instantly share code, notes, and snippets.

@puzpuzpuz
Created Jan 9, 2022
Embed
What would you like to do?
e2-highcpu-32 VM with 32 vCPUs (Intel Haswell), 32 GB memory, Ubuntu 20.04, OpenJDK 17.0.1
32 threads:
Benchmark (type) Mode Cnt Score Error Units
LockBenchmark.testBaseline N/A avgt 10 35.386 ± 0.206 ns/op
LockBenchmark.testLock JUC_UNFAIR avgt 10 1297.444 ± 9.895 ns/op
LockBenchmark.testLock JUC_FAIR avgt 10 283315.363 ± 19745.189 ns/op
LockBenchmark.testLock CAS_SPIN_LOCK avgt 10 48758.628 ± 121.294 ns/op
LockBenchmark.testLock BACKOFF_CAS_SPIN_LOCK avgt 10 1753.691 ± 20.733 ns/op
LockBenchmark.testLock BACKOFF_TTAS_SPIN_LOCK avgt 10 2080.310 ± 39.543 ns/op
LockBenchmark.testLock TICKET_SPIN_LOCK avgt 10 20797.627 ± 891.228 ns/op
LockBenchmark.testLock MCS_LOCK avgt 10 278629.063 ± 14552.165 ns/op
LockBenchmark.testLock MCS_SPIN_LOCK avgt 10 15587.097 ± 785.566 ns/op
16 threads:
Benchmark (type) Mode Cnt Score Error Units
LockBenchmark.testBaseline N/A avgt 10 17.588 ± 0.089 ns/op
LockBenchmark.testLock JUC_UNFAIR avgt 10 633.150 ± 2.602 ns/op
LockBenchmark.testLock JUC_FAIR avgt 10 148643.124 ± 6985.621 ns/op
LockBenchmark.testLock CAS_SPIN_LOCK avgt 10 21276.050 ± 482.583 ns/op
LockBenchmark.testLock BACKOFF_CAS_SPIN_LOCK avgt 10 732.360 ± 23.180 ns/op
LockBenchmark.testLock BACKOFF_TTAS_SPIN_LOCK avgt 10 810.022 ± 42.934 ns/op
LockBenchmark.testLock TICKET_SPIN_LOCK avgt 10 7504.140 ± 920.938 ns/op
LockBenchmark.testLock MCS_LOCK avgt 10 150179.629 ± 5628.804 ns/op
LockBenchmark.testLock MCS_SPIN_LOCK avgt 10 4446.553 ± 92.338 ns/op
8 threads:
Benchmark (type) Mode Cnt Score Error Units
LockBenchmark.testBaseline N/A avgt 10 17.015 ± 0.049 ns/op
LockBenchmark.testLock JUC_UNFAIR avgt 10 316.098 ± 1.147 ns/op
LockBenchmark.testLock JUC_FAIR avgt 10 74660.477 ± 2811.697 ns/op
LockBenchmark.testLock CAS_SPIN_LOCK avgt 10 6494.730 ± 51.756 ns/op
LockBenchmark.testLock BACKOFF_CAS_SPIN_LOCK avgt 10 336.847 ± 24.356 ns/op
LockBenchmark.testLock BACKOFF_TTAS_SPIN_LOCK avgt 10 363.767 ± 26.557 ns/op
LockBenchmark.testLock TICKET_SPIN_LOCK avgt 10 2219.451 ± 18.209 ns/op
LockBenchmark.testLock MCS_LOCK avgt 10 72457.352 ± 3144.717 ns/op
LockBenchmark.testLock MCS_SPIN_LOCK avgt 10 2085.306 ± 60.382 ns/op
4 threads:
Benchmark (type) Mode Cnt Score Error Units
LockBenchmark.testBaseline N/A avgt 10 18.804 ± 0.041 ns/op
LockBenchmark.testLock JUC_UNFAIR avgt 10 155.673 ± 0.556 ns/op
LockBenchmark.testLock JUC_FAIR avgt 10 37238.098 ± 1217.514 ns/op
LockBenchmark.testLock CAS_SPIN_LOCK avgt 10 1782.459 ± 15.173 ns/op
LockBenchmark.testLock BACKOFF_CAS_SPIN_LOCK avgt 10 160.339 ± 17.037 ns/op
LockBenchmark.testLock BACKOFF_TTAS_SPIN_LOCK avgt 10 169.751 ± 24.377 ns/op
LockBenchmark.testLock TICKET_SPIN_LOCK avgt 10 982.372 ± 9.618 ns/op
LockBenchmark.testLock MCS_LOCK avgt 10 35858.288 ± 807.150 ns/op
LockBenchmark.testLock MCS_SPIN_LOCK avgt 10 1186.545 ± 199.337 ns/op
2 threads:
Benchmark (type) Mode Cnt Score Error Units
LockBenchmark.testBaseline N/A avgt 10 18.823 ± 0.034 ns/op
LockBenchmark.testLock JUC_UNFAIR avgt 10 350.819 ± 22.864 ns/op
LockBenchmark.testLock JUC_FAIR avgt 10 11120.871 ± 5246.161 ns/op
LockBenchmark.testLock CAS_SPIN_LOCK avgt 10 479.140 ± 7.875 ns/op
LockBenchmark.testLock BACKOFF_CAS_SPIN_LOCK avgt 10 75.712 ± 18.551 ns/op
LockBenchmark.testLock BACKOFF_TTAS_SPIN_LOCK avgt 10 81.578 ± 22.431 ns/op
LockBenchmark.testLock TICKET_SPIN_LOCK avgt 10 386.126 ± 4.539 ns/op
LockBenchmark.testLock MCS_LOCK avgt 10 16433.731 ± 366.203 ns/op
LockBenchmark.testLock MCS_SPIN_LOCK avgt 10 584.281 ± 7.824 ns/op
1 thread:
Benchmark (type) Mode Cnt Score Error Units
LockBenchmark.testBaseline N/A avgt 10 18.718 ± 0.013 ns/op
LockBenchmark.testLock JUC_UNFAIR avgt 10 37.338 ± 0.021 ns/op
LockBenchmark.testLock JUC_FAIR avgt 10 37.149 ± 0.044 ns/op
LockBenchmark.testLock CAS_SPIN_LOCK avgt 10 34.938 ± 0.019 ns/op
LockBenchmark.testLock BACKOFF_CAS_SPIN_LOCK avgt 10 34.939 ± 0.030 ns/op
LockBenchmark.testLock BACKOFF_TTAS_SPIN_LOCK avgt 10 34.883 ± 0.025 ns/op
LockBenchmark.testLock TICKET_SPIN_LOCK avgt 10 35.187 ± 0.028 ns/op
LockBenchmark.testLock MCS_LOCK avgt 10 39.983 ± 0.119 ns/op
LockBenchmark.testLock MCS_SPIN_LOCK avgt 10 39.309 ± 0.042 ns/op
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment