-
Notifications
You must be signed in to change notification settings - Fork 902
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
Faster rules validation #694
Conversation
d96bdcd
to
c580b7f
Compare
689de25
to
5c54ea2
Compare
Json-related filtercheck fields supported indexing with brackets, but when looking at the field descriptions you couldn't tell if a field allowed an index, required an index, or did not allow an index. This information was available, but it was a part of the protected aliases map within the class. Move this to the public field information so it can be used outside the class. Also add m_ prefixes for member names, now that the struct isn't trivial. Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
Instead of iterating over the entire list of filters and doing pattern matches against each defined filter, perform table lookups. For filters that take arguments e.g. proc.aname[3] or evt.arg.xxx, split the filtercheck string on bracket/dot and check the values against a table. There are now two tables of defined filters: defined_arg_filters and defined_noarg_filters. Each filter is put into a table depending on whether the filter takes an argument or not. Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
We shouldn't need to clean up strings via a cleanup function and don't need to do it via a bunch of string.gsub() functions. Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
This is faster than iteration + string case changes. Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
To speed up list expansion, instead of using regexes to replace a list name with its contents, do string searches followed by examining the preceding/following characters for the proper delimiter. Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
5c54ea2
to
9e7b59e
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.
LGTM !
LGTM label has been added. Git tree hash: 10e776a4a8ddeb7de69bfe2d5969c90f2ad4eb6f
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: leodido 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 |
I'm going to merge this, as it has a lgtm and travis passed. I don't know why tide says the tests have not passed, though. |
@mstemm travis-ci.com has a bug and does not report back the status to github in a correct way. So, once we have all green and lgtm we just merge. When we will switch to the new CI @markyjackson-taulia is working on PRs will be automatically merged as before. |
What type of PR is this?
/kind feature
Any specific area of the project related to this PR?
/area engine
What this PR does / why we need it:
Improve rule loading performance by optimizing lua parsing paths to avoid expensive pattern matches.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: