Commit 20b052d
committed
Merge #522: feat: added benchmarking binary for torrent repository struct
ebb7d4c chore: make Containerfile use nightly rust (Warm Beer)
1735a7a chore: only run contract, deployment & testing jobs in nightly rust (Warm Beer)
6087e4f feat: added benchmarking binary for torrent repository (Warm Beer)
Pull request description:
Moved the `Tracker.torrents` field to be its own `TorrentRepository` struct with different implementations.
Added a new crate that benchmarks the different `TorrentRepository` implementations for speed.
### Run benchmarks
```shell
cargo run --release -p torrust-torrent-repository-benchmarks -- --threads 4 --sleep 0 --compare true
```
#### Example result
```shell
tokio::sync::RwLock<std::collections::BTreeMap<InfoHash, Entry>>
add_one_torrent: Avg/AdjAvg: (146ns, 0ns)
update_one_torrent_in_parallel: Avg/AdjAvg: (5.965616ms, 5.816375ms)
add_multiple_torrents_in_parallel: Avg/AdjAvg: (14.050554ms, 14.132902ms)
update_multiple_torrents_in_parallel: Avg/AdjAvg: (7.201337ms, 7.120315ms)
std::sync::RwLock<std::collections::BTreeMap<InfoHash, Entry>>
add_one_torrent: Avg/AdjAvg: (82ns, 83ns)
update_one_torrent_in_parallel: Avg/AdjAvg: (27.311075ms, 26.869114ms)
add_multiple_torrents_in_parallel: Avg/AdjAvg: (28.967141ms, 28.967141ms)
update_multiple_torrents_in_parallel: Avg/AdjAvg: (48.316966ms, 0ns)
std::sync::RwLock<std::collections::BTreeMap<InfoHash, Arc<std::sync::Mutex<Entry>>>>
add_one_torrent: Avg/AdjAvg: (137ns, 125ns)
update_one_torrent_in_parallel: Avg/AdjAvg: (5.057729ms, 5.057729ms)
add_multiple_torrents_in_parallel: Avg/AdjAvg: (48.833962ms, 48.833962ms)
update_multiple_torrents_in_parallel: Avg/AdjAvg: (6.193212ms, 6.071166ms)
tokio::sync::RwLock<std::collections::BTreeMap<InfoHash, Arc<std::sync::Mutex<Entry>>>>
add_one_torrent: Avg/AdjAvg: (174ns, 166ns)
update_one_torrent_in_parallel: Avg/AdjAvg: (5.56332ms, 5.56332ms)
add_multiple_torrents_in_parallel: Avg/AdjAvg: (16.360504ms, 15.872786ms)
update_multiple_torrents_in_parallel: Avg/AdjAvg: (6.800225ms, 6.890521ms)
tokio::sync::RwLock<std::collections::BTreeMap<InfoHash, Arc<tokio::sync::Mutex<Entry>>>>
add_one_torrent: Avg/AdjAvg: (192ns, 208ns)
update_one_torrent_in_parallel: Avg/AdjAvg: (6.374304ms, 6.17711ms)
add_multiple_torrents_in_parallel: Avg/AdjAvg: (17.313591ms, 17.089898ms)
update_multiple_torrents_in_parallel: Avg/AdjAvg: (6.955371ms, 6.975057ms)
```
### Relevant issues
#496
#495
Top commit has no ACKs.
Tree-SHA512: 062d18c91b1d89ab95eda5ddc2cb7674d481b705a21c43e9cf3a11e0bf71e52bb6bccd5b5e4404fcf8ebdc442764dd60006c6962aac2a414c4b4cdecfa422a67File tree
19 files changed
+1117
-128
lines changed- .github/workflows
- packages/torrent-repository-benchmarks
- src
- benches
- src/core
- services
- torrent
- tests
19 files changed
+1117
-128
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
| 74 | + | |
73 | 75 | | |
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
80 | | - | |
| 82 | + | |
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
0 commit comments