Skip to content

Optimize torrent/peers list reading and writing by breaking up the tracker.torrents field into smaller pieces #495

@mickvandijke

Description

@mickvandijke

We were talking about refactoring the torrents map in the Tracker struct to reduce the amount of write locks needed on the entire torrents map. This would theoretically improve torrent announce performance when you have a lot of torrents being updated at the same time.

Refactor:

torrents: RwLock<std::collections::BTreeMap<InfoHash, torrent::Entry>>,

To:

torrents: RwLock<std::collections::BTreeMap<InfoHash, Arc<Mutex<torrent::Entry>>>>,

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions