vimpunk / cratetorrent

A BitTorrent V1 engine library for Rust (and currently Linux)
473 stars 35 forks source link

Improve piece turnaround #83

Open vimpunk opened 3 years ago

vimpunk commented 3 years ago

Currently we wait for disk IO to run to completion. We could hash piece, notify torrent of piece completion, and then attempt a write. This would mean that a failed write would cause an invalid advertisement. Should be a pathological edge case? Once #23 is implemented this shouldn't be a problem in any case.

From libtorrent:

Fundamentally, performance in a bittorrent swarm is achieved by all peers also uploading content. The quicker you can turn around from having downloaded a piece until you can upload it, the better performance and the lower latency before you can take advantage of your upload capacity.