-
Notifications
You must be signed in to change notification settings - Fork 203
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
Reduce memory usage by removing unnecessary regex #894
Reduce memory usage by removing unnecessary regex #894
Conversation
Codecov ReportBase: 73.84% // Head: 73.92% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #894 +/- ##
==========================================
+ Coverage 73.84% 73.92% +0.08%
==========================================
Files 23 23
Lines 14576 14643 +67
==========================================
+ Hits 10763 10825 +62
- Misses 3813 3818 +5
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. |
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 Thanks for your pull request.
LGTM
@hitenkoku |
@fukusuket PRありがとうございます! |
@YamatoSecurity |
6.1GB evtxに対して手元のMac環境で試したところ(それぞれ測定前に再起動, 2回ずつ測定)、以下の結果でした🤔 Environment
|
@fukusuket Hummm, yea, it might just be my environment so I will check tonight on a different computer. |
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!
When checking on my Windows environment.
Speed improvement: 25:25 -> 24:45
Memory reduction: 7.6GB -> 7.2GB
Thank you for your review and benchmark :) |
What Changed
Reduced memory usage(about 200-300MB
in the data below) by removing regex compilation process when the search can be replaced with the fast search below.
eq_ignore_ascii_case()
beforeregular expression match
#884string length match
beforeregular expression match
#883Changed pipe startswith/endswith matching from regex to Imporving speed by changing
wildcard
search process fromregular expression
match tostarts_with/ends_with
match #890 match.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🙏