Yamato-Security / hayabusa-evtx

A fork of the evtx Rust crate for Hayabusa
Apache License 2.0
6 stars 2 forks source link

Improve speed test by using Mimalloc #14

Closed hitenkoku closed 1 year ago

hitenkoku commented 1 year ago

https://github.com/Yamato-Security/hayabusa/pull/777#issue-1419666787 にもある通りメモリアロケータをMimallocに変えることで処理速度が向上したのでhayabusa-evtxにも導入する

fukusuket commented 1 year ago

@YamatoSecurity @hitenkoku

I got the benchmark on the branch and results is as follows. :)

before Elapsed time: 00:00:17.178 Elapsed time: 00:00:17.776 Elapsed time: 00:00:17.528

after Elapsed time: 00:00:17.100 Elapsed time: 00:00:17.457 Elapsed time: 00:00:17.626

Setting mimalloc in evtx crate doesn't seem to affect performance🤔

According to the following comments in forum, You can't set multi global allocator in one binary :( https://users.rust-lang.org/t/how-to-make-multi-global-allocator-in-one-binary-or-dylib/36643

I also checked the implementation evtx ...🔍 The global allocator was only set in evtx_dump.rs(RpMalloc, Jmelloc), Therefore I think the mimalloc setting affects performance only when the evtx_dump command directly executed.

hitenkoku commented 1 year ago

@fukusuket Thanks for your research. Your reserach is very helpful.

@YamatoSecurity hayabusa performace do not improved through adding mimalloc in evtx crate by this research. So I want to close this issue.