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

[WIP] Swap over to yara-x; improve performance and readability #734

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

egibs
Copy link
Member

@egibs egibs commented Dec 22, 2024

After hacking around with yara-x locally last night, the performance gains over Yara are definitely noticeable (usually 2x faster at minimum).

I wanted to get this rather large refactor up to test the CI experience again since we have to build the API from scratch, but when refreshing the sample data locally I was down to about ~24-25 seconds with the integration tests taking about 27 seconds (on my M1 Pro MBP).

Edit, we're about 3-4x faster in GHA with 8-core runners:

go test -timeout 0 ./tests/...
ok  	github.com/chainguard-dev/malcontent/tests	49.979s

This is usually around ~170s.

That said, I plan on using 16-core runners to help with the yara-x build.

This PR also cleans up recursiveScan and fixes the behavior of longestUnique and splits out path-related functions into a new path.go file. Additionally, findFilesRecursively will locate files concurrently to help with large numbers of files.

Outside of the longestUnique changes, output is essentially 1:1 with the current implementation.

@egibs egibs added the do-not-merge This PR is not suitable for merging label Dec 22, 2024
@egibs egibs force-pushed the use-yara-x-take-2 branch 6 times, most recently from 7172cfd to b2110f7 Compare December 22, 2024 05:25
Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
@egibs egibs force-pushed the use-yara-x-take-2 branch from b2110f7 to 3583808 Compare December 22, 2024 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge This PR is not suitable for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant