-
Notifications
You must be signed in to change notification settings - Fork 912
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
perf: change falco_engine::process_event to lookup sources by index #1944
perf: change falco_engine::process_event to lookup sources by index #1944
Conversation
/milestone 0.32.0 |
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.
/approve
LGTM label has been added. Git tree hash: 7c000edc51789a565a0a6a328c2678e30fe0d428
|
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 looks great @deepskyblue86!! Left you a minor suggestion, let me know what you think before approving.
userspace/engine/falco_engine.h
Outdated
first(n), second(p) {} | ||
|
||
// pair-like names | ||
std::string first; // source |
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.
Since we don't need pair<>
anymore, wouldn't it be better to give these more significant names? This would make it more understandable for newcomer fellow contributors. My vote would go to name these source
and ruleset
. Let me know what you think!
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 was uncertain about it... let's do it 👍
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.
... done 😸
falco_engine::process_event gets called for every inspector event. Profiling showed that std::map::find takes about 10% of falco_engine::process_event, and that can easily improved by accessing the source by index. Signed-off-by: Angelo Puglisi <[email protected]>
d1e2c14
to
5ad8138
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.
/approve
Thanks 🥳
LGTM label has been added. Git tree hash: a2ca25c54f9702042bd9d4a523d2f28585886208
|
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.
/milestone 0.32.0
/approve
Thank you!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deepskyblue86, jasondellaluce, leogr 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 |
What type of PR is this?
falco_engine::process_event
gets called for every inspector event.Profiling showed that std::map::find takes about 10% of
falco_engine::process_event
, and that can easily be improved by accessing the source by index.How I tested it
https://gist.github.com/deepskyblue86/91ca71de9b464e5dcd87deac1b911a6d
Results
/kind feature
Any specific area of the project related to this PR?
/area engine
What this PR does / why we need it:
falco_engine::process_event performance enhancement
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: