-
Notifications
You must be signed in to change notification settings - Fork 601
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
All filter optimization #7300
All filter optimization #7300
Conversation
Signed-off-by: Calum Murray <[email protected]>
Signed-off-by: Calum Murray <[email protected]>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #7300 +/- ##
=======================================
Coverage 77.64% 77.65%
=======================================
Files 250 250
Lines 13436 13473 +37
=======================================
+ Hits 10432 10462 +30
- Misses 2480 2487 +7
Partials 524 524
☔ View full report in Codecov by Sentry. |
} | ||
} | ||
|
||
func (filter *allFilter) optimize(swapIdx int) { |
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.
not sure i like the generic optimize
func name...
can we add a bit why it does the swap?
c chan int | ||
d chan bool |
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.
More auto-describing names than c
or d
?
// Short circuit to optimize it | ||
if res == eventfilter.FailFilter { | ||
filter.c <- i |
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'm worried about this could block if the background gorouting is not listening at that point, I think we need buffering (with size 1 seems fine) and avoid blocking when the buffer is full
Signed-off-by: Calum Murray <[email protected]>
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
/hold for @matzew
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
/approve
/unhold
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Cali0707, matzew, pierDipi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fixes #7147
Proposed Changes
The results of this optimization are:
However, it is worth noting that the "Creation" time actually measures creation and deletion time because I needed to clean up the goroutines.
Pre-review Checklist
Release Note