New torrent repository: FxHashMap for Peer List#796
Closed
josecelano wants to merge 2 commits intotorrust:developfrom
Closed
New torrent repository: FxHashMap for Peer List#796josecelano wants to merge 2 commits intotorrust:developfrom
josecelano wants to merge 2 commits intotorrust:developfrom
Conversation
instead of a BTreeMap. Some tests fail becuase it does not keep the order. The performace is similiar to the BTreeMap: BTreeMap: ```output Requests out: 400847.83/second Responses in: 361008.64/second - Connect responses: 178712.68 - Announce responses: 178730.98 - Scrape responses: 3564.99 - Error responses: 0.00 Peers per announce response: 0.00 Announce responses per info hash: - p10: 1 - p25: 1 - p50: 1 - p75: 1 - p90: 2 - p95: 3 - p99: 105 - p99.9: 293 - p100: 363 ``` HashMap: ```output Requests out: 410866.90/second Responses in: 368759.97/second - Connect responses: 182729.63 - Announce responses: 182390.37 - Scrape responses: 3639.97 - Error responses: 0.00 Peers per announce response: 0.00 Announce responses per info hash: - p10: 1 - p25: 1 - p50: 1 - p75: 1 - p90: 2 - p95: 3 - p99: 105 - p99.9: 297 - p100: 365 ```
This collection uses a faster hasher. The performance is similar. With FxHashMap: ```output Requests out: 398119.46/second Responses in: 358307.63/second - Connect responses: 177148.18 - Announce responses: 177562.09 - Scrape responses: 3597.36 - Error responses: 0.00 Peers per announce response: 0.00 Announce responses per info hash: - p10: 1 - p25: 1 - p50: 1 - p75: 1 - p90: 2 - p95: 3 - p99: 105 - p99.9: 289 - p100: 371 ``` With BTreeMap: ```output Requests out: 400847.83/second Responses in: 361008.64/second - Connect responses: 178712.68 - Announce responses: 178730.98 - Scrape responses: 3564.99 - Error responses: 0.00 Peers per announce response: 0.00 Announce responses per info hash: - p10: 1 - p25: 1 - p50: 1 - p75: 1 - p90: 2 - p95: 3 - p99: 105 - p99.9: 293 - p100: 363 ``` It does not make sense sice the collections is not ordered and the performace is similar.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relates to: #774
New torrent repository using a FxHashMap for the peer list instead of a BTreeMap.
WIP: Some tests fail because it does not keep the order. This PR is only intended to check the performance. The performance is similar to the BTreeMap, so replacing it does not make sense if we lose the order. The order makes results deterministic.
BTreeMap:
FxHashMap:
I won't merge it: