-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parallelizing Swarm<T>.PreloadAsync() #846
Conversation
a109bfc
to
2f483c7
Compare
Codecov Report
@@ Coverage Diff @@
## master #846 +/- ##
==========================================
- Coverage 87.51% 87.50% -0.02%
==========================================
Files 249 249
Lines 22601 22620 +19
==========================================
+ Hits 19779 19793 +14
- Misses 1477 1481 +4
- Partials 1345 1346 +1
|
Libplanet/Net/Swarm.cs
Outdated
{ | ||
return (peer, pong); | ||
} | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding the cancellationToken
to ContinueWith
?
Libplanet/Net/Swarm.cs
Outdated
} | ||
|
||
return t.Result.Where(pair => !(pair.Item1 is null)).ToArray(); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding the cancellationToken
to ContinueWith
?
Libplanet/Net/Swarm.cs
Outdated
else if (!(t.Result is Pong pong)) | ||
{ | ||
// Mark to skip | ||
return (null, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about combining these multiple conditions into one?
2f483c7
to
7d7bf04
Compare
Amended a commit to applying the suggestion (7d7bf04) |
This PR increases the performance of
Swarm<T>.PreloadAsync()
by parallelizingDialToExistingPeers()
.