-
Notifications
You must be signed in to change notification settings - Fork 209
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
Improving speed by adding string length match
before regular expression match
#883
Improving speed by adding string length match
before regular expression match
#883
Conversation
Codecov ReportBase: 69.59% // Head: 69.67% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #883 +/- ##
==========================================
+ Coverage 69.59% 69.67% +0.07%
==========================================
Files 23 23
Lines 13719 13716 -3
==========================================
+ Hits 9548 9556 +8
+ Misses 4171 4160 -11
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@fukusuket thank you for your PR. |
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.
@fukusuket Thank you very much for your patience.
I have sent one suggestion.
I would appreciate it if you could check it out.
Co-authored-by: DustInDark <2350416+hitenkoku@users.noreply.github.com>
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.
Thank you for your fixing.
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.
I verified that it detects all of the same alerts.
Benchmark against 14 GB data:
current main branch: 32 minutes (peak memory 7.9GB)
PR: 27 minutes 53 seconds (peak memory 7.7 GB)
13.7% speed increase! Great performance optimization!
Thank you for your review :) |
What Changed
Added
string length match
beforeregular expression match
(regex matching will be skipped if the length is not same).regular expression match
on unmatched strings is especially slow.case-insensitive match
is the default behavior in Sigma, soexact string match
cannot be used.string length match
instead ofexact string match
.regular expression match
is applied as before)Evidence
Environment
Benchmark1
I ran a benchmark using this procedure(6.1GB evtx) and the results were as follows.
Console output
before
This PR
Benchmark2
I ran a benchmark using hayabusa-sample-evtx and the results were as follows.
I would appreciate it if you could review🙏