poc: Refactor Kad Engine to poll based implementation #306
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.
PoC to highlight the work needed to refactor KademliaEngine to a poll-based implementation.
Currently, the engine is busy polling the associated queries on every iteration of
loop { tokio::select! }
.This leads to resource inefficiencies and delays in processing query events.
This PoC in combination with subp2p-exporer showed a best case scenario for 1000 peers discovered in Kusama of:
The results are mixed, since some runs show no improvements, while others are only a few seconds better in the range of 34-36 seconds.
The PoC needs to be extended for all query types, it currently extends
FindNone
. No context waker optimizations are applied either.