Skip to content
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

To reduce ram usage and performance, Replaced String with other crate #793

Merged
merged 37 commits into from
Nov 5, 2022

Conversation

hitenkoku
Copy link
Collaborator

@hitenkoku hitenkoku commented Nov 5, 2022

Closes #790 , Closes #789

What Changed

  • To improve memory usage, removed a few call static variables.
  • To improve memory usage, replaced Vec with Nested.
  • To improve memory usage, replaced String Object in DetectInfo with CompactString.
  • Updated changelog.

Evidence

analyzed result to 2GB evtx file by the following environment.

  • CPU: Ryzen 5700G
  • RAM: 16GB
  • OS: Windows 11
step prev memory usage in 4701a41 memory usage(prev step diff percent) improved in fba1688
start process 31% 24% - 29%
finished analyze 94%(+63%) 78%(+54%) 18% 82%(+53%)
finished output 94%(0%) 80%(+2%) 16% 83%(+1%)

output time ( in 4701a41)

Elapsed time: 00:03:28.181
Saved file: output.csv (610.9 MB)

output time(in fba1688 )

Elapsed time: 00:03:26.145
Saved file: output-2.csv (610.9 MB)

target is following tags.

- %MitreTactics%
- %MitreTags%
- %OtherTags%
@hitenkoku hitenkoku added the enhancement New feature or request label Nov 5, 2022
@hitenkoku hitenkoku added this to the v1.8.0 milestone Nov 5, 2022
@hitenkoku hitenkoku self-assigned this Nov 5, 2022
Copy link
Collaborator

@YamatoSecurity YamatoSecurity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@hitenkoku hitenkoku marked this pull request as ready for review November 5, 2022 14:46
@hitenkoku hitenkoku changed the title Test reduce ram usage remove linked hashmap To reduce ram usage and performance, Replaced String with other crate Nov 5, 2022
@hitenkoku hitenkoku merged commit e4980ff into main Nov 5, 2022
@hitenkoku hitenkoku deleted the test-reduce_ram_usage_remove_linked_hashmap branch November 5, 2022 15:01
@hitenkoku
Copy link
Collaborator Author

hitenkoku commented Nov 5, 2022

thank you for your review. I merged it.

@fukusuket
Copy link
Collaborator

fukusuket commented Nov 5, 2022

Compared to the main branch before merging, I have confirmed the following performance improvements!!
(6.1GB evtx)

  • before-fix: Mem(avg):6.85 Mem(max):9.48
  • after-fix : Mem(avg):6.45 Mem(max):8.89
    (Since the OS uses about 3GB of memory, the actual usage is -3GB.)

Mem(avg): -0.40GB Mem(max):-0.59GB Great imporvements ! 🚀
(and I also confirmed that the number of detections was the same before and after fix.)

LGTM:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants