Closed secDre4mer closed 3 days ago
Since this hasn't seen any attention so far: @plusvic do performance improvements like this still have a chance of being merged (since YARA doesn't gain any more features and effort instead goes into yara-x)? If not, I'd like to close this.
Sorry for the delayed response, this fell trough the cracks. As this is a relatively important change, and all my efforts are put now in YARA-X I prefer not merging this PR. So I'm closing it.
Instead of completely zeroing match lists at the end of each scan (which is O(num_strings) and thus scales badly with large rule sets), keep track of which list entries have been used. Only those entries need to be zeroed at the end. This essentially changes the O(num_strings) to O(num_matched_strings), which is usually far lesser.