MCPcopy Create free account
hub / github.com/Super-long/ChubbyGo / BenchmarkDelete_ChubbyGo_SyncMap

Function BenchmarkDelete_ChubbyGo_SyncMap

MapPerformanceTest/test_test.go:472–490  ·  view source on GitHub ↗

(chubbyGoMap.Sync.map)

(b *testing.B)

Source from the content-addressed store, hash-verified

470
471// (chubbyGoMap.Sync.map)
472func 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}

Callers

nothing calls this directly

Calls 2

ChubbyGoMapSetMethod · 0.80
ChubbyGoMapDeleteMethod · 0.80

Tested by

no test coverage detected