undirtied-chunks-iter_test.go | 22 ++++++++++++++++++++++ diff --git a/undirtied-chunks-iter_test.go b/undirtied-chunks-iter_test.go new file mode 100644 index 0000000000000000000000000000000000000000..d9b12df4bf31d885a348c699e429eb403bf9d927 --- /dev/null +++ b/undirtied-chunks-iter_test.go @@ -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) { + + }) + } +}