(slm ShardLockMaps, b *testing.B)
| 334 | } |
| 335 | |
| 336 | func benchmarkMultiGetSetBlockWithMap(slm ShardLockMaps, b *testing.B) { |
| 337 | finished := make(chan struct{}, 2*b.N) |
| 338 | get, set := GetSet(slm, finished) |
| 339 | for i := 0; i < 100; i++ { |
| 340 | set(strconv.Itoa(i), "value") |
| 341 | } |
| 342 | b.ResetTimer() |
| 343 | for i := 0; i < b.N; i++ { |
| 344 | go set(strconv.Itoa(i%100), "value") |
| 345 | go get(strconv.Itoa(i%100), "value") |
| 346 | } |
| 347 | for i := 0; i < 2*b.N; i++ { |
| 348 | <-finished |
| 349 | } |
| 350 | } |
no test coverage detected