Open mafintosh opened 10 years ago
"Rarest first" is also a good strategy: http://www.bittorrent.org/bittorrentecon.pdf
I already implemented this for bittorrent-client here if anyone wants to port back over to torrent-stream. Note that bittorrent-client's internal piece selection logic is just a cleaned up, more modular version of torrent-stream's, so the port should be relatively straightforward.
On a side note, we really need to set a gameplan for better coordination between these two projects.
Also note that rarest first is essentially equivalent to random selection in a healthy torrent but performs significantly better in an unhealthy torrent, so there's no reason not to go with rarest first over random.
In order to be better swarm citizens we should probably think about changing piece strategy in all critical pieces have been downloaded.
A simple way of doing this would be do fetch random pieces if the selection array is empty.