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

Function BenchmarkPutKeyNoExist_ConcurrentMap

MapPerformanceTest/test_test.go:48–65  ·  view source on GitHub ↗

(ConcurrentMap)

(b *testing.B)

Source from the content-addressed store, hash-verified

46
47//(ConcurrentMap)
48func BenchmarkPutKeyNoExist_ConcurrentMap(b *testing.B){
49 Map := BaseServer.NewConcurrentMap()
50
51 groups := sync.WaitGroup{}
52 groups.Add(ThreadNumber)
53
54 b.ResetTimer()
55
56 for j:=0; j < ThreadNumber; j++{
57 go func(){
58 for i := 0; i < b.N; i++ {
59 Map.Set(strconv.Itoa(i), "lizhaolong")
60 }
61 groups.Done()
62 }()
63 }
64 groups.Wait()
65}
66
67// (Sync.map)
68func BenchmarkPutKeyNoExist_SyncMap(b *testing.B){

Callers

nothing calls this directly

Calls 1

SetMethod · 0.80

Tested by

no test coverage detected