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

Parallelize compilation of YARA rules during installation #540

Closed
s3rvac opened this issue Apr 8, 2019 · 0 comments
Closed

Parallelize compilation of YARA rules during installation #540

s3rvac opened this issue Apr 8, 2019 · 0 comments

Comments

@s3rvac
Copy link
Member

s3rvac commented Apr 8, 2019

Current state

When you run cmake with -DRETDEC_COMPILE_YARA=ON (the default), YARA rules that RetDec uses are compiled during the installation step, which makes decompilations run faster (no need to compile them on the fly during each decompilation).

Drawback

YARA rules are compiled sequentially, which takes around 50 seconds to compile them on my machine.

Suggestion

We could parallelize their compilation, either by using all available cores (easy), or by taking the /m or -j parameter into account (harder, as I am not sure if we are able to get the value of this parameter in install-yara.py).

s3rvac added a commit that referenced this issue Apr 8, 2019
).

When you run cmake with -DRETDEC_COMPILE_YARA=ON (the default), YARA rules that
RetDec uses are compiled during the installation step, which makes
decompilations run faster (no need to compile them on the fly during each
decompilation). The issue is that YARA rules are compiled sequentially, which
takes around 50 seconds to compile them on my machine.

This commit parallelizes their compilation by using all available cores. Now,
the compilation takes around 10 seconds on my machine (Intel Xeon E5-1650 @
3.60GHz, 6 cores with HT = 12 threads).
@s3rvac s3rvac self-assigned this Apr 8, 2019
PeterMatula pushed a commit that referenced this issue Apr 24, 2019
* support: Parallelize compilation of YARA rules during installation (#540).

When you run cmake with -DRETDEC_COMPILE_YARA=ON (the default), YARA rules that
RetDec uses are compiled during the installation step, which makes
decompilations run faster (no need to compile them on the fly during each
decompilation). The issue is that YARA rules are compiled sequentially, which
takes around 50 seconds to compile them on my machine.

This commit parallelizes their compilation by using all available cores. Now,
the compilation takes around 10 seconds on my machine (Intel Xeon E5-1650 @
3.60GHz, 6 cores with HT = 12 threads).

* support: Do not create a pool when there are no YARA files to compile.

There is no need to create a thread pool when there are no YARA files to
compile. This saves us a bit of time during each re-install.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant