A looping regex on a huge section. I rewrote it as strings + a small loop in the condition. Core time dropped 40x.
Profile the rules. Then rewrite the one. Then profile again.
Refs: YARA
Lab / educational. Public binaries and patched classes only. Isolated VM.