-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Do more efficient matching of filter subjects in consumer #4864
Conversation
Benchmark (from the first commit) before doing the actual changes:
After the changes:
|
We, at Holoplot, would like to see this merged as we would like to start using multiple filter subjects on consumers in our project. However we found that the performance degrades significantly with larger numbers of filter subjects. |
I do not really embrace the way this is done, but I tried to follow the example of the existing code that does subject sub-matching. I started working on a more holistic approach where I introduced a |
fd6cc67
to
2c5bd95
Compare
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.
In general looks good! A couple of comments.
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.
This is a nice optimzation!
Just some small comments.
Signed-off-by: Sven Neumann <[email protected]>
Avoid tokenizing the message subject again for every filter subject that it is matched against. Also keep the tokenized version of the filter subjects in the subjectFilter struct. Signed-off-by: Sven Neumann <[email protected]>
Make use of the consumers' tokenized filter subjects. Signed-off-by: Sven Neumann <[email protected]>
a930e59
to
187a665
Compare
Signed-off-by: Sven Neumann <[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!
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! - Thanks for the contribution!
Avoid tokenizing the message subject again for every filter subject that it is matched against. Also keep the tokenized version of the filter subjects in the subjectFilter struct.
Signed-off-by: Sven Neumann [email protected]