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

Function BenchmarkDelete_BaseMap

MapPerformanceTest/test_test.go:388–406  ·  view source on GitHub ↗

*3.--------------测试并发Delete操作--------------*/

(b *testing.B)

Source from the content-addressed store, hash-verified

386/*3.--------------测试并发Delete操作--------------*/
387
388func BenchmarkDelete_BaseMap(b *testing.B) {
389 Map := BaseServer.NewBaseMap()
390
391 groups := sync.WaitGroup{}
392 groups.Add(ThreadNumber)
393
394 b.ResetTimer()
395
396 for j:=0; j < ThreadNumber; j++{
397 go func(){
398 for i := 0; i < b.N; i++ {
399 Map.BaseStore(strconv.Itoa(i), "lizhaolong")
400 Map.BaseDelete(strconv.Itoa(i-1))
401 }
402 groups.Done()
403 }()
404 }
405 groups.Wait()
406}
407
408//(ConcurrentMap)
409func BenchmarkDelete_ConcurrentMap(b *testing.B){

Callers

nothing calls this directly

Calls 2

BaseStoreMethod · 0.95
BaseDeleteMethod · 0.95

Tested by

no test coverage detected