Performance optimization: create a new torrent repository using a SkipMap
instead of a BTreeMap
#777
Labels
Optimization
Make it Faster
SkipMap
instead of a BTreeMap
#777
Relates to: #774
To simplify the description of the issue, we can say that we are using a torrent repository like this:
Check the discussion for more details.
One performance optimization proposal was to replace the outer
BTreeMap
with a data structure that allows for the simultaneous insertion of new torrents.Another issue is trying with a different structure: a DashMap.
DashMap is based on sharding and does not keep the order of items. The other issues have not been merged yet because we need the order for the API. However, we are also discussing if we need to keep the order and what order to use.
The DashMap API is also very different to the BTreeMap one.
On the other hand, SkipMap API is very similar to the BTreeMap, and it keeps items ordered. Since the effort to implement was not too big I decided to do it.
SkipMap is being used in other trackers in Rust (https://github.com/Power2All/torrust-actix).
The text was updated successfully, but these errors were encountered: