kad: Store peers in btreemap for kbuckets #335
Labels
priority: low
Nice-to-have improvements, optimizations, or future considerations
todo
Extracted from code todos
At the moment, we store the peers of a k-bucket in a vector.
Investigate if storing peers in a BTreeMap in ascending order of their distance from local key would bring any benefit performance-wise. Considering that we need to sort the records on
closest_iter
depending on the target key, I would lean towards not having to pay for the performance hit of BTreeMap, would be good to have a second look.litep2p/src/protocol/libp2p/kademlia/bucket.rs
Lines 58 to 62 in e0b7118
The text was updated successfully, but these errors were encountered: