(chubbyGoMap.Sync.map)
(b *testing.B)
| 470 | |
| 471 | // (chubbyGoMap.Sync.map) |
| 472 | func BenchmarkDelete_ChubbyGo_SyncMap(b *testing.B){ |
| 473 | chubbyGoMap := BaseServer.NewChubbyGoMap(BaseServer.SyncMap) |
| 474 | |
| 475 | groups := sync.WaitGroup{} |
| 476 | groups.Add(ThreadNumber) |
| 477 | |
| 478 | b.ResetTimer() |
| 479 | |
| 480 | for j:=0; j < ThreadNumber; j++{ |
| 481 | go func(){ |
| 482 | for i := 0; i < b.N; i++ { |
| 483 | chubbyGoMap.ChubbyGoMapSet(strconv.Itoa(i), "lizhaolong") |
| 484 | chubbyGoMap.ChubbyGoMapDelete(strconv.Itoa(i-1)) |
| 485 | } |
| 486 | groups.Done() |
| 487 | }() |
| 488 | } |
| 489 | groups.Wait() |
| 490 | } |
nothing calls this directly
no test coverage detected