(b *testing.B)
| 249 | } |
| 250 | |
| 251 | func benchmarkMultiGetSetDifferent(b *testing.B) { |
| 252 | slm := NewShardLockMaps() |
| 253 | finished := make(chan struct{}, 2*b.N) |
| 254 | get, set := GetSet(slm, finished) |
| 255 | slm.Set("-1", "value") |
| 256 | b.ResetTimer() |
| 257 | for i := 0; i < b.N; i++ { |
| 258 | go set(strconv.Itoa(i-1), "value") |
| 259 | go get(strconv.Itoa(i), "value") |
| 260 | } |
| 261 | for i := 0; i < 2*b.N; i++ { |
| 262 | <-finished |
| 263 | } |
| 264 | } |
| 265 | |
| 266 | func benchmarkMultiGetSetBlock(b *testing.B) { |
| 267 | slm := NewShardLockMaps() |
nothing calls this directly
no test coverage detected