This website requires JavaScript.
Explore
Help
Sign In
dlss
/
FedP2P
Watch
4
Star
0
Fork
You've already forked FedP2P
0
Code
Issues
Pull Requests
Projects
Releases
Wiki
Activity
d0a23d3369
FedP2P
/
request-strategy
/
torrent.go
7 lines
97 B
Go
Raw
Normal View
History
Unescape
Escape
Prepare to implement max unverified bytes
2021-05-14 09:50:41 +08:00
package
request_strategy
Use interfaces to lazily expose the bare minimum inputs to GetRequestablePieces
2021-12-01 16:21:25 +08:00
type
Torrent
interface
{
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 12:22:05 +08:00
IgnorePiece
(
int
)
bool
Use interfaces to lazily expose the bare minimum inputs to GetRequestablePieces
2021-12-01 16:21:25 +08:00
PieceLength
(
)
int64
Prepare to implement max unverified bytes
2021-05-14 09:50:41 +08:00
}