Add a test for allocations in undirtiedChunksIter.Iter
This commit is contained in:
parent
3a3307632a
commit
9b9a37eee6
|
@ -0,0 +1,22 @@
|
|||
package torrent
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/RoaringBitmap/roaring"
|
||||
)
|
||||
|
||||
func BenchmarkUndirtiedChunksIter(b *testing.B) {
|
||||
var bitmap roaring.Bitmap
|
||||
a := undirtiedChunksIter{
|
||||
TorrentDirtyChunks: &bitmap,
|
||||
StartRequestIndex: 69,
|
||||
EndRequestIndex: 420,
|
||||
}
|
||||
b.ReportAllocs()
|
||||
for i := 0; i < b.N; i++ {
|
||||
a.Iter(func(chunkIndex chunkIndexType) {
|
||||
|
||||
})
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue