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

Function BenchmarkPutGet_ChubbyGo_SyncMap

MapPerformanceTest/test_test.go:366–384  ·  view source on GitHub ↗

(chubbyGoMap.Sync.map)

(b *testing.B)

Source from the content-addressed store, hash-verified

364
365// (chubbyGoMap.Sync.map)
366func BenchmarkPutGet_ChubbyGo_SyncMap(b *testing.B){
367 chubbyGoMap := BaseServer.NewChubbyGoMap(BaseServer.SyncMap)
368
369 groups := sync.WaitGroup{}
370 groups.Add(ThreadNumber)
371
372 b.ResetTimer()
373
374 for j:=0; j < ThreadNumber; j++{
375 go func(){
376 for i := 0; i < b.N; i++ {
377 chubbyGoMap.ChubbyGoMapSet(strconv.Itoa(i), "lizhaolong")
378 chubbyGoMap.ChubbyGoMapGet(strconv.Itoa(i-1))
379 }
380 groups.Done()
381 }()
382 }
383 groups.Wait()
384}
385
386/*3.--------------测试并发Delete操作--------------*/
387

Callers

nothing calls this directly

Calls 2

ChubbyGoMapSetMethod · 0.80
ChubbyGoMapGetMethod · 0.80

Tested by

no test coverage detected