FedP2P/request-strategy
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
..
ajwerner-btree.go Add AjwernerBtree as an alternative btree backing for piece request order 2022-01-22 18:40:33 +11:00
order.go Avoid heap allocation in GetRequestablePieces (#734) 2022-04-11 14:22:05 +10:00
peer.go Dynamic outbound max requests 2021-12-24 08:55:57 +11:00
piece-request-order.go Add AjwernerBtree as an alternative btree backing for piece request order 2022-01-22 18:40:33 +11:00
piece-request-order_test.go Add AjwernerBtree as an alternative btree backing for piece request order 2022-01-22 18:40:33 +11:00
piece.go Use interfaces to lazily expose the bare minimum inputs to GetRequestablePieces 2021-12-12 18:35:01 +11:00
tidwall-btree.go Add AjwernerBtree as an alternative btree backing for piece request order 2022-01-22 18:40:33 +11:00
torrent.go Avoid heap allocation in GetRequestablePieces (#734) 2022-04-11 14:22:05 +10:00