Skip to content
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

Improve performance with else if #32

Open
widhalmt opened this issue Sep 26, 2022 · 2 comments
Open

Improve performance with else if #32

widhalmt opened this issue Sep 26, 2022 · 2 comments

Comments

@widhalmt
Copy link
Member

The current filters have a lot of if checks. But when we look closely we see that most events can only match one filter in a file and not many. So after the first match we can skip testing for more hits. This skipping can be achieved by changing if into else if.

So check all filter files and replace if with else if where appropriate.

@widhalmt
Copy link
Member Author

Hint: Filter for a single component, View as big a timeframe as possible and have Kibana show you which messages are the most common (there's a postfix.event_type field for that). Then sort all filters so that the most used are on top. Do this before changing to else if and you'll end up with an optimised file.

@widhalmt
Copy link
Member Author

But keep in mind that not all Postfix setups are alike and you can only tune for one kind. So don't overdo it.

widhalmt added a commit that referenced this issue Sep 27, 2022
widhalmt added a commit that referenced this issue Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant