-
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
Optimized the exact filter performance #7311
Conversation
Signed-off-by: Calum Murray <cmurray@redhat.com>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #7311 +/- ##
==========================================
- Coverage 77.66% 77.63% -0.04%
==========================================
Files 250 250
Lines 13436 13444 +8
==========================================
+ Hits 10435 10437 +2
- Misses 2478 2482 +4
- Partials 523 525 +2
☔ View full report in Codecov by Sentry. |
/lgtm |
/cc @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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Cali0707, 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 #7307
Currently, we use the attributes filter internally when running the exact filter. However, the attributes filter supports cases which the exact filter does not allow. Specifically, the current implementation of the exact filter requires that all filters have a non-empty string value for both the attribute and the desired value, while the attributes filter checks if the desired value is "", and treats that as a special "allow anything" case. By rewriting the exact filter with these more strict requirements, we see a speed up in terms of performance.
To see the current creation-time validation logic, look here:
eventing/pkg/eventfilter/subscriptionsapi/exact_filter.go
Lines 39 to 44 in 44aa15e
Proposed Changes
With these changes, the performance difference is:
Pre-review Checklist
Release Note
Docs