a8m / a8m/syncmap

The case BenchmarkRange seems has some problem ?

オープン
#10 コメント 1 件 リアクション 0 件 担当者 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 を短くまとめたダイジェスト。