6 typedRoaring "github.com/anacrolix/torrent/typed-roaring"
9 func BenchmarkIterUndirtiedRequestIndexesInPiece(b *testing.B) {
10 var bitmap typedRoaring.Bitmap[RequestIndex]
11 it := bitmap.IteratorType()
13 for i := 0; i < b.N; i++ {
14 // This is the worst case, when Torrent.iterUndirtiedRequestIndexesInPiece can't find a
15 // usable cached iterator. This should be the only allocation.
16 it.Initialize(&bitmap)
17 iterBitmapUnsetInRange(&it, 69, 420, func(RequestIndex) {})