Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
storage/spanlatch: use linked list instead of map for readSet
This change replaces the Manager's `readSet` map implementation with a linked-list implementation. This provides the following speedup: ``` name old time/op new time/op delta LatchManagerReadOnlyMix/size=1-4 683ns ± 9% 404ns ±10% -40.85% (p=0.008 n=5+5) LatchManagerReadOnlyMix/size=4-4 660ns ± 7% 382ns ± 5% -42.17% (p=0.008 n=5+5) LatchManagerReadOnlyMix/size=16-4 684ns ±10% 367ns ± 5% -46.27% (p=0.008 n=5+5) LatchManagerReadOnlyMix/size=64-4 683ns ± 8% 370ns ± 1% -45.75% (p=0.016 n=5+4) LatchManagerReadOnlyMix/size=128-4 678ns ± 4% 398ns ±14% -41.27% (p=0.008 n=5+5) LatchManagerReadOnlyMix/size=256-4 652ns ± 4% 385ns ± 4% -40.95% (p=0.008 n=5+5) LatchManagerReadWriteMix/readsPerWrite=0-4 594ns ±16% 629ns ±17% ~ (p=0.222 n=5+5) LatchManagerReadWriteMix/readsPerWrite=1-4 603ns ± 1% 552ns ± 7% -8.39% (p=0.008 n=5+5) LatchManagerReadWriteMix/readsPerWrite=4-4 621ns ± 4% 576ns ± 5% -7.28% (p=0.008 n=5+5) LatchManagerReadWriteMix/readsPerWrite=16-4 649ns ± 2% 541ns ±13% -16.69% (p=0.008 n=5+5) LatchManagerReadWriteMix/readsPerWrite=64-4 474ns ± 5% 423ns ±29% ~ (p=0.151 n=5+5) LatchManagerReadWriteMix/readsPerWrite=128-4 413ns ± 2% 362ns ±16% ~ (p=0.095 n=5+5) LatchManagerReadWriteMix/readsPerWrite=256-4 448ns ±14% 314ns ±13% -29.85% (p=0.008 n=5+5) name old alloc/op new alloc/op delta LatchManagerReadOnlyMix/size=1-4 191B ± 0% 160B ± 0% -16.23% (p=0.008 n=5+5) LatchManagerReadOnlyMix/size=4-4 191B ± 0% 160B ± 0% -16.23% (p=0.008 n=5+5) LatchManagerReadOnlyMix/size=16-4 191B ± 0% 160B ± 0% -16.23% (p=0.008 n=5+5) LatchManagerReadOnlyMix/size=64-4 191B ± 0% 160B ± 0% ~ (p=0.079 n=4+5) LatchManagerReadOnlyMix/size=128-4 191B ± 0% 160B ± 0% -16.23% (p=0.008 n=5+5) LatchManagerReadOnlyMix/size=256-4 191B ± 0% 160B ± 0% -16.23% (p=0.008 n=5+5) LatchManagerReadWriteMix/readsPerWrite=0-4 144B ± 0% 160B ± 0% +11.11% (p=0.008 n=5+5) LatchManagerReadWriteMix/readsPerWrite=1-4 144B ± 0% 160B ± 0% +11.11% (p=0.008 n=5+5) LatchManagerReadWriteMix/readsPerWrite=4-4 144B ± 0% 160B ± 0% +11.11% (p=0.008 n=5+5) LatchManagerReadWriteMix/readsPerWrite=16-4 144B ± 0% 160B ± 0% +11.11% (p=0.008 n=5+5) LatchManagerReadWriteMix/readsPerWrite=64-4 144B ± 0% 160B ± 0% +11.11% (p=0.008 n=5+5) LatchManagerReadWriteMix/readsPerWrite=128-4 144B ± 0% 160B ± 0% +11.11% (p=0.008 n=5+5) LatchManagerReadWriteMix/readsPerWrite=256-4 144B ± 0% 160B ± 0% +11.11% (p=0.008 n=5+5) name old allocs/op new allocs/op delta LatchManagerReadOnlyMix/size=1-4 1.00 ± 0% 1.00 ± 0% ~ (all equal) LatchManagerReadOnlyMix/size=4-4 1.00 ± 0% 1.00 ± 0% ~ (all equal) LatchManagerReadOnlyMix/size=16-4 1.00 ± 0% 1.00 ± 0% ~ (all equal) LatchManagerReadOnlyMix/size=64-4 1.00 ± 0% 1.00 ± 0% ~ (all equal) LatchManagerReadOnlyMix/size=128-4 1.00 ± 0% 1.00 ± 0% ~ (all equal) LatchManagerReadOnlyMix/size=256-4 1.00 ± 0% 1.00 ± 0% ~ (all equal) LatchManagerReadWriteMix/readsPerWrite=0-4 1.00 ± 0% 1.00 ± 0% ~ (all equal) LatchManagerReadWriteMix/readsPerWrite=1-4 1.00 ± 0% 1.00 ± 0% ~ (all equal) LatchManagerReadWriteMix/readsPerWrite=4-4 1.00 ± 0% 1.00 ± 0% ~ (all equal) LatchManagerReadWriteMix/readsPerWrite=16-4 1.00 ± 0% 1.00 ± 0% ~ (all equal) LatchManagerReadWriteMix/readsPerWrite=64-4 1.00 ± 0% 1.00 ± 0% ~ (all equal) LatchManagerReadWriteMix/readsPerWrite=128-4 1.00 ± 0% 1.00 ± 0% ~ (all equal) LatchManagerReadWriteMix/readsPerWrite=256-4 1.00 ± 0% 1.00 ± 0% ~ (all equal) ``` The change also makes Manager's zero value completely usable. Release note: None
- Loading branch information