-
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
Minor optimizations/v1 #12398
base: master
Are you sure you want to change the base?
Minor optimizations/v1 #12398
Conversation
Until now the implementation would scan the stream, fallback to the packet payload, then keep track of where the match was and in the flow match logic reject the match if it was in the wrong buffer. This patch simplifies this logic, by refusing to inspect the packet payload when `only_stream` is set.
To assist branch prediction, which showed a 100% miss rate, assume pstate is non-NULL. Code review suggests all paths leading to the function actually check pstate first, or alstate which can only be non-NULL if pstate was first initialized. For now add a debug check.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #12398 +/- ##
==========================================
- Coverage 80.63% 80.63% -0.01%
==========================================
Files 917 917
Lines 258687 258696 +9
==========================================
+ Hits 208601 208608 +7
- Misses 50086 50088 +2
Flags with carried forward coverage won't be shown. Click here to find out more. |
// Failed to allocate larger memory for all the SIDS, but | ||
// keep as many as we can. | ||
sids_size = pmq->rule_id_array_size - pmq->rule_id_array_cnt; | ||
if (sids_size > 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.
Not following why is an extra indentation preferable over return if base condition doesn't match.
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.
The logic I think is that it assumes the first branch (so sids_size == 0 leading to return) to be the most likely.
Information: QA ran without warnings. Pipeline 24219 |
Misc optimizations from running vtune.