-
Notifications
You must be signed in to change notification settings - Fork 303
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
fix: evaluate after filter #2363
Conversation
Since the final length of the filter is the candidateParentLimit used, the parents after the filter is the returned parents. Signed-off-by: Gaius <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #2363 +/- ##
=======================================
Coverage 49.70% 49.70%
=======================================
Files 148 148
Lines 19644 19646 +2
=======================================
+ Hits 9765 9766 +1
Misses 9267 9267
- Partials 612 613 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
I suggest evaluating and sorting candidates peers before filtering them for these reasons:
- the complexity of evaluating is far low than filtering. The filtering need Lock on DAG, may slow the speed of scheduling. The filter process will stop at once when there is enough candidates(it would be 4 candidates if filtering after sort, but 40 when sort after filter)
- The scheduling is not atomic(sometimes a candidate peer is good when filtering, but may become bad because assignments on other scheduling goroutines), so the process is the faster the better
- when evaluatoring and sorting, it would be better if more peers are included.
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.
lgtm
Since the final length of the filter is the candidateParentLimit used, the parents after the filter is the returned parents. Signed-off-by: Gaius <[email protected]>
Since the final length of the filter is the candidateParentLimit used, the parents after the filter is the returned parents.
Description
Related Issue
Motivation and Context
Screenshots (if appropriate)
Types of changes
Checklist