chainguard-dev / bincapz

detect malicious program behaviors
Apache License 2.0
380 stars 24 forks source link

Reduce memory usage by 30% through use of pointers #211

Closed tstromberg closed 2 months ago

tstromberg commented 2 months ago

This PR changes it so that larger data structures are always passed by reference.

It also removes the FileReport.PackageRisk, as it showed up in the memory trace and seemed duplicative of the keys in FileReport.Behaviors.

When run against a directory with 19,000 files, this PR reduced memory usage from 100MB to 69MB.

Part of #204