Commit Graph

3 Commits

Author SHA1 Message Date
Matt Joiner 9a9c7dee00
Add and use typed roaring bitmap 2022-05-09 12:05:50 +10:00
Jonathan McDowell a1a820d3c9
Avoid heap allocation in GetRequestablePieces (#734)
The calculation of whether we should ignore a piece in
GetRequestablePieces ends up doing an allocation for every piece, when
all we really need to do is query the index in the torrent. Provide an
IgnorePiece function instead, which avoids the need for a temporary
allocation.

Observed to cut out 40% of object allocations in some workloads (large
download, lots of seeds).
2022-04-11 14:22:05 +10:00
Matt Joiner 135f21fb64 Use interfaces to lazily expose the bare minimum inputs to GetRequestablePieces 2021-12-12 18:35:01 +11:00