mirror of
https://github.com/github/codeql.git
synced 2026-04-27 09:45:15 +02:00
The main source of slowness in `BrokenCryptoAlgorithm.ql` was that the regexp on function (macro) names was evaluated once per call (invocation) instead of once per name. Factoring out separate predicates for the problematic functions (macros) fixes this. On https://github.com/ericniebler/range-v3, this change reduces the run time of the two slowest predicates from BrokenCryptoAlgorithm::InsecureMacroSpec#class#f .... 35.1s BrokenCryptoAlgorithm::InsecureFunctionCall#class#f . 12.8s to BrokenCryptoAlgorithm::getAnInsecureFunction#f . 1.2s BrokenCryptoAlgorithm::getAnInsecureMacro#f .... 12ms