a8m / a8m/syncmap

The case BenchmarkRange seems has some problem ?

未關閉
#10 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Go
星號
256
分支
17
PR 合併指標
30 天內沒有已合併 PR

描述

```
// syncmap code:
b.Run(fmt.Sprintf("%T", &IntMap{}), func(b *testing.B) {
m := &IntMap{}
// setup:

// reset:
b.ResetTimer()

// perG:
perG := func(b *testing.B, pb *testing.PB, i int, m *IntMap) {
for ; pb.Next(); i++ {
m.Range(func(_, _ int) bool { return true })
}
}
var i int64
b.RunParallel(func(pb *testing.PB) {
id := int(atomic.AddInt64(&i, 1) - 1)
perG(b, pb, id*b.N, m)
})
})
```

seems the setup function is nil, then the map is empy, so at the benrchmark result, it seems vary fast

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。